How do I undo last merge?
Using git reset to Undo a Merge
This way, using “HEAD~1”, you’re telling Git to go back to the commit before the current HEAD revision — which should be the commit before the merge!
Can we revert the merge in Git?
Because the merge is a commit that points the HEAD to a specific commit, we can undo the merge commit and roll back to the pre-merge state.