There is a safer alternative to git push --force.
git push --force
Use --force-with-lease and --force-if-includes to restrict force pushes so that they don’t unintentionally overwrite commits pushed by others.
--force-with-lease
--force-if-includes
git push --force-with-lease --force-if-includes