How To Revert a Merge in GIT

To revert the local branch:
1 |
$ git reset --hard HEAD~1 |
To revert the remote branch AFTER the previous step has been performed:
1 |
$ git push origin HEAD --force |
![]() |
To revert the local branch:
1 |
$ git reset --hard HEAD~1 |
To revert the remote branch AFTER the previous step has been performed:
1 |
$ git push origin HEAD --force |
shell$ git log | head -1 commit a203e1bd04718bff10a3df4a3389c493c97c0432 Use the commit string as the last argument to the git revert command: shell$ git revert -m 1 a203e1bd04718bff10a3df4a3389c493c97c0432