How to delete a commit in Git that is already pushed to a remote branch and present in my coworkers local repos?
The first part is relatively easy (deleting a commit locally and from the remote is already well described on stack overflow, for example: Delete commits from a branch in Git)
But the problem arises when that faulty commit (or a set of commits) has been already downloaded by other coworkers. When they execute git pull
command, the removed commit will still appear in their local history so that the commit can be restored...how to avoid it?
Is there a sort of git pull --force
command that will disregard local commits that have been deleted from remote?