I have performed git commit followed by a git push. How can I revert that change on both local and remote repositories?
git commit
git push
$ git log
git reset --hard HEAD~1 git push -f
(Example push: git push -f origin bugfix/bug123)
git push -f origin bugfix/bug123
This will undo the last commit and push the updated history to the remote. You need to pass the -f because you're replacing upstream history in the remote.
-f