If you are using git and erroneously merged another branch to the current local branch you can undo this mistake by `git reset --hard HEAD~1` command, which get you back 1 commit.
The original answer was found here.
The original answer was found here.