There may be certain situations when you do the changes and merge the working branch on the master branch. Later on, you realize that you missed something on the commit and you want to make those changes on the same commit. You can revert the git merge by following ways.
The condition here is you have not pushed to the remote master branch.
You can revert the merge by finding out the commit prior to the merge by doing “git reflog”.
Then do the following
git reset --hard commit_hash
You can also use the following way which will get you back to 1 commit
git reset --hard HEAD~1