git push --force-with-lease
git push --force-with-lease
Risk: Can lose work
What it does
Overwrites the remote branch with yours. Other people's commits there can be lost.
When to use it
Only on your own branch, after a rebase or amend.
Example
$ git push --force-with-leaseForce, but stop if someone else pushed since your last fetch.
$ git push --forceForce with no safety check. Avoid it.
Learn it in: Force push, safely · Official docs