how to go back into an older branch before a merge 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
git reset --hard HEAD~1
git reset --hard <commit_sha>
git reset --hard HEAD~1