- 8 min read
You are in 'detached HEAD' state: what it means and what to do
Git's detached HEAD paragraph is advice, not an alarm. What HEAD names while detached, where commits land, and the one command that keeps them.
- 8 min read
How to revert a merge commit (and re-merge the branch later)
git revert refuses a merge commit until -m picks a parent. What the numbers mean, why re-merging the branch brings nothing back, and the Reapply escape.
- 8 min read
Recover uncommitted changes after git reset --hard
git reset --hard took work you never committed. If you ever staged it, Git kept a blob: how to dig it back out with git fsck and git show.
- 10 min read
Undo a hard reset: how far the reflog reaches
git reset --hard didn't destroy your commits. How to read the reflog, point a branch back at lost work, and know where the journal has holes.
- 12 min read
Is it safe to delete .git/index.lock?
Git says another process seems to be running. What .git/index.lock is, the one check to run before deleting it, and what a hard kill leaves behind.
- 9 min read
What FETCH_HEAD is, and why you shouldn't merge it
FETCH_HEAD holds whatever the last fetch brought — any fetch, including your editor's. Merge it by name and the branch can swap between your two commands.
- 9 min read
git pull --rebase deleted your commit: the rescue and the reason
A force-pushed branch plus git pull --rebase silently drops commits you pushed. The reflog rescue, the fork-point mechanism, and why no flag prevents it.
- 4 min read
Recovering a dropped stash: what git fsck can still find
A dropped or lost git stash is almost never gone. How to find it with git fsck, tell the real stash commit from its index twin, and get the work back.