git fsck --unreachable

Category: Git - Advanced

git fsck --unreachable

Find objects not reachable from any ref

Lists commits, trees, and blobs that no branch, tag, or reflog reaches, often the remains of rebases and resets. These are candidates for recovery with git show or for pruning with git gc. The --lost-found option writes dangling objects to disk.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.