git undo remote merge code example Example 1: git undo merge Click to copygit reset --hard HEAD~1 Example 2: revert last merge git Click to copygit revert -m 1 commit_hash