cancel a merge github code example
Example 1: cancel merge
git merge --abort
Example 2: undo a git merge
git reset --hard HEAD~1
git reset --hard <commit_sha>
Example 3: revert last merge git
git revert -m 1 commit_hash
git merge --abort
git reset --hard HEAD~1
git reset --hard <commit_sha>
git revert -m 1 commit_hash