If your repository is synced by others, then you should not push any history changes unless you are certain nobody has pulled the bad changes yet.
To rewrite history (dangerous), do an empty commit locally (git commit --allow-empty
) to diverge your HEAD from the remote HEAD, then push --force
to rewrite the server's history.