It is bad only if others have already pulled from your repo.
They would need to fetch, and reset their master branch to yours, or their own master branch would diverge as well, and they would be tempted to do a git push -f
, effectively erasing what you just pushed!
They wouldn't necessarily think to do a git pull --rebase
, as I describe in "master
branch and 'origin/master
' have diverged, how to 'undiverge' branches'?".
So it is a communication issue (with the rest of the team).
But if you are the only one working one master, then git push -f
is fine.
Instead of a reset --hard
, you could simply have done and added to the index your modifications, and then do a:
git commit --amend
git push -f
(That avoid the "reset the working tree" effect of the "reset --hard
", which can be a bit dangerous if you had any work in progress)
The following diagram representing the OP's situation shows:

The forced pushed (ME) erased at least one commit of the "other guy".
It is important to communicate with them in order to check if they did a pull --rebase
, or if they want to restore the repo as it was before your forced push.
for your next commit, git revert
remains the way to go (in order to push a new commit cancelling your bad commit): no forced push there.