Git Commands That Save You
The 80 commands that undo, recover and unblock.
Loading rating…
149 Xeem / 30 daysXeem — earned, never bought. Show up daily on waxeem.com and unlocking stays free.
Peek inside — 3 of 84 cards
Undo the last commit, keep the changes staged?
git reset --soft HEAD~1
Find a commit you 'lost' after a bad reset?
git reflog — then reset to the entry
Move your last commit to a new branch?
git branch new-branch && git reset --hard HEAD~1 && git checkout new-branch
About this deck
Organised by the moment you need it: 'I committed to the wrong branch', 'I need that deleted file back', 'the rebase went wrong'. The front is the situation; the back is the exact command and what it will not touch.
Includes the daily drivers too — but the reason this deck exists is the reflog card you will one day be very glad you studied.
Ratings & feedback
Loading feedback…