How to rewrite Git history without losing your work
A junior dev tried to delete the .git folder to undo a bad merge. Here is what to do instead: the three trees, the three git reset modes, git revert for commits you already pushed, and the reflog for when a hard reset takes the wrong thing.