This can also be done safely from the git cli with the `--force-with-lease` option. `--force-with-lease` will only do the push if the latest ref you&#x27;ve fetched from the remote matches the current ref of the remote. There&#x27;s a few options you can give it, too, so I recommend reading the docs: <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-push" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-push</a>