How to undo a pushed commit with git revert
Run git revert <commit-id>, then git push. Revert creates a new commit that does the exact opposite of the one you name. Nothing is deleted, so it's safe on branches your teammates already have.
Step by step
Find the id of the commit to undo:
$ git log --onelineCreate a commit that undoes it:
$ git revert a1b2c3dShare the fix:
$ git push
Never use git reset to remove a commit you already pushed: your branch and everyone else's would diverge. Revert is the team-friendly undo.