how to reverse git merge remotes/origin/master code example Example: undo a git merge git reset --hard HEAD~1 git reset --hard <commit_sha>