xxxxxxxxxx
//if no conflict and merge completed then:
git reset --hard HEAD~1
//if while doing a merge got conflict then abort will take you out of the recent merge changes:
git merge --abort
//or if you want to revert back to a specific commit id.
git reset --hard <commit-id>
xxxxxxxxxx
git reset --hard HEAD~1
# to go back to merged verson:
git reset --hard ORIG_HEAD