Git recovery

← All tools

Git mistakes are common. This decision tree asks what happened, whether you pushed, and whether you need to keep changes — then gives step-by-step commands with a danger level for each path.

About this tool

This is not a substitute for reading git help on your exact situation — it covers the "oh no" moments that come up repeatedly: wrong branch, unpushed amend, deleted branch, merge abort, secrets in history.

Pushed commits on shared branches should almost always be fixed with git revert, not reset --hard plus force push. The tree calls that out on every relevant path.

Read more

Free books, courses, and software

Get my programming books, course editions, and complete software.

Get the download library →