how to revert last merge in git code example
Example 1: undo a git merge
git reset --hard HEAD~1
git reset --hard <commit_sha>
Example 2: git undo merge
git reset --hard HEAD~1
Example 3: revert last merge git
git revert -m 1 commit_hash
Example 4: git revert pr merge
git revert -m 1 b76a5f1f5d3b323679e466a1a1d5f93c8828b269 (Commit Number)
Example 5: git revert last 2 commits
$ git revert --no-commit D
$ git revert --no-commit C
$ git revert --no-commit B
$ git commit -m "the commit message"