A commit is reachable if you can walk from any ref (branch, tag, HEAD, reflog) backward through parents to it.
Reachability is Git's garbage-collection criterion:
- Reachable → kept forever (compressed in packs).
- Unreachable → kept until reflog expires +
gc runs, then deleted.
Operations that orphan commits:
git reset --hard to an earlier commit — the dropped commits become unreachable.
git rebase — pre-rebase commits are unreachable.
- Branch deletion — if no other ref pointed at the tip.
The reflog acts as a 90-day safety net: even unreachable from refs, reflog keeps them alive.
Tools:
git fsck --unreachable # list all unreachable objects
git fsck --dangling # list objects with no parents, no refs
A "dangling commit" in fsck output is a commit you've orphaned. git reset --hard <hash> restores it as long as it's still in the object database.