- 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.
- 8 min read
Force push without overwriting your teammate's work
git push --force-with-lease protects you only until something fetches. The gap, demonstrated live, and the flag that closes it: --force-if-includes.
- 6 min read
Work on two branches at once with git worktree
git worktree gives a second branch its own folder — one repository, two working trees, no stash dance. The rules that keep it safe, and the cleanup.
- 9 min read
Update a Git branch without checking it out
git fetch origin main:main moves a branch while you stay on another. The refspec that does it, the refusals that protect you, and the diverged case.