Git: Force push safely
A short, tested Git example for force push safely. Copy it and adjust the names and paths for your project.
Git
git push --force-with-lease--force-with-lease refuses to overwrite commits you haven't seen, unlike plain --force.
Find it in Zest
Search for “git force push safely” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.