Skip to content
Recovery

Lost Work

Finding commits nothing points at, across every source it scans, and putting a branch back on one.

GitAegis
GitAegis Lost Work results, listing commits that no ref points at any more, each with the source it was found in and the option to put a branch back on it.
Commits nothing points at any more, with the source each was recovered from.

What counts as lost

Commits that still exist in the object database but that no branch or tag points at any more: work lost to a hard reset, an amended commit, a deleted branch, an abandoned rebase, or a dropped stash. Doctor (⌘5) → Lost Work. Everything on this tab is read-only until you choose to recover a candidate.

The six sources

Lost Work sources
SourceWhat is read
Refloggit reflog -n 40
Stash refloggit stash list
Flight Recorderthe “before” oids of ref movements in the last 100 events
GitAegis recovery refseverything under refs/aegis/
Capsulesgit bundle list-heads over the 5 most recent capsules’ repository.bundle
Sibling clonesthe HEADs of registered worktrees

How candidates are filtered and ranked

A candidate reachable from any branch or tag is discarded. It is not lost. An oid that no longer resolves to an object is discarded too. Each surviving candidate is enriched with its author, date, subject and changed-file counts, then ranked with recency dominant.

The reasons behind each rank are shown next to it, so you can judge the ranking rather than trust it.

A ranked Lost Work candidate with the rationale behind its position and the source it was found in.
Each candidate carries the source it came from and why it ranks where it does.

Deep scan, and its bound

Those six sources are cheap, which is why they are the default. Deep scan, in the top right of the tab, adds a git fsck --unreachable --dangling walk of the object database and merges the unreachable and dangling commits it reports into the same ranked list. It reads the object database rather than sampling logs, so it finds work no reflog remembers, and on a large repository it takes noticeably longer, which is why it stays a request rather than the default. Press it again to go back to the shallow scan.

The walk is bounded: the first 200 commits fsck reports are examined and the rest are not, because each candidate costs two further Git invocations to verify. The budget counts commits, never fsck’s output lines: dangling blobs and trees usually outnumber commits by orders of magnitude and would otherwise spend the whole allowance before the first commit was read. The tab states the bound whenever deep scan is on. A bounded walk that presents itself as exhaustive is the one failure this feature cannot afford.

Recovering a candidate

Select it and choose Recover to a new branch. This opens the standard operation preview and, on confirmation, runs a single command:

the whole operation
git branch <name> <oid>

It is a safe-risk operation. Its preconditions are that the candidate still resolves and that the branch name is not already taken; afterwards GitAegis verifies that the new branch points at exactly that commit. Nothing else in your repository is touched: no checkout, no reset, no index change, and no existing ref is ever overwritten.

What it cannot find

  • Work that was never committed. Lost Work searches the object database. Uncommitted edits and untracked files were never in it. That is what a capsule is for.
  • Objects that have been destroyed. A git gc, git prune or git reflog expire run in your own terminal can remove the very objects every source here points at. GitAegis never runs them; nothing stops your shell from doing so.
  • Anything from before GitAegis opened the repository in the two sources it owns. The reflog and the object database predate it; the Flight Recorder, refs/aegis/ and the capsule bundles start when GitAegis first opened the repository.

30-day trial · No card required

A recovery capsule before every risky Git operation.

You see the exact commands before they run, and the operation is refused if the capsule cannot be written.

Requires Git 2.38.0 or newer, already installed.

Every risky operation, in this order

  1. Previewthe exact commands, shown before anything runs
  2. Capsulerefs, index, staged and working changes, untracked files, operation state: written to disk first
  3. Executethe commands as shown, or not at all
  4. Journalplan, commands, capsule id, outcome
No capsule, no operation. Restore plans, previews, and takes its own capsule.