A faulty commit has already been pushed to a shared branch your teammates work on. Which command undoes its changes without rewriting the branch's existing history?
Explanation
`git revert` creates a new commit that applies the inverse of the faulty commit's changes, so history only grows — safe on a shared branch. `git reset --hard` plus a force push and `git commit --amend` both rewrite published history, forcing every teammate to repair their local branches. `git checkout <commit>` merely moves you to that commit (detaching HEAD) and undoes nothing on the branch.