Oh Shit, Git!?!
A short page of Git recovery recipes organised by the mistake you just made rather than by the command you need. Bookmark it before you need it, because you will need it.
Cheat sheet
Other
Katie Sylor-Miller
Seconds per lookup
All
Free
What it is
A single page listing common Git disasters and the exact commands that undo them. Committed to the wrong branch, committed with the wrong author, need to change a commit message, accidentally reset and lost work, need to undo a merge.
Why the organisation is right
Every other Git reference is organised by command, which is useless in the moment, because your problem is described in terms of what went wrong and not in terms of the tool that fixes it. Indexing by mistake is the correct index for a panicking user.
The one to internalise
Reflog. Git almost never actually loses a commit, and reflog is how you find it again. Knowing that this page exists, and that reflog is on it, removes most of the fear that makes people avoid the more useful Git commands.
Best for: everyone, bookmarked, permanently.
Ready to start?
Opens on Katie Sylor-Miller in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Every session is free; a few slots open each week.
Follow along
New writing, resources and project ideas land here first.