half way on a merge and revert an old commit code example Example: git undo merge git reset --hard HEAD~1 git reset --hard <commit_sha>