how to revert a branch merge in git code example
Example 1: undo a git merge
git reset --hard HEAD~1
git reset --hard <commit_sha>
Example 2: git revert merge
git revert -m 1 <merge-commit>
Example 3: git undo merge
git reset --hard HEAD~1
git reset --hard HEAD~1
git reset --hard <commit_sha>
git revert -m 1 <merge-commit>
git reset --hard HEAD~1