Skip to content
Recovery

Recovering your work

The runbook. What to check, in what order, and what never to run. Start here in an emergency.

GitAegis
GitAegis Doctor showing a repository finding, the evidence behind it, and the proposed repair with its capsule step visible in the plan.
Every finding carries its evidence, and every repair takes a capsule before it runs.

Before you touch anything

Four rules, in this order. They cost about a minute and they decide whether the rest of this page can help you.

  • Do not run git gc, git prune or git reflog expire. These delete the objects most recovery paths depend on. GitAegis never runs them, not in a repair, not in a maintenance task, not anywhere.
  • Do not delete or re-clone the repository. Almost everything recoverable is inside the copy you still have.
  • Take a capsule now, before you attempt a fix. Press ⌘K, type Create Recovery Capsule, run it. That makes the attempted fix itself reversible.
  • If GitAegis says the repository is in Safe Mode, read the Safe Mode article before clicking anything. Safe Mode means the index or HEAD cannot be trusted, and operations that would normally be routine are not.

Find the symptom

Four mechanisms cover almost every case, and they do not overlap much. Match the symptom, then read that mechanism’s article.

Symptom to recovery surface
What happenedWhere to look
An operation you ran in GitAegis went wrongDoctor (⌘5) → Capsules. The capsule taken before that operation is the way back, domain by domain.
A branch moved and you do not know whyDoctor → Flight Recorder. It records ref movements GitAegis caused and ones it did not, with the previous oid on each.
Commits are gone: a hard reset, an amend, a deleted branch, an abandoned rebase, a dropped stashDoctor → Lost Work. It looks for commits that still exist in the object database but that no ref points at.
Git itself is complaining: a broken index, a stuck lock, a half-finished mergeDoctor → Overview, then Run health scan. Read the finding’s evidence before applying its repair.
The app stopped while an operation was runningThe operation is reconciled to requires-intervention at the next launch. Read “After a crash”.
Work that was never committed at allOnly a capsule can hold that. Lost Work searches the object database, and uncommitted content was never in it.

The order to work in

  1. Capture the current state. Create a capsule. Whatever you do next now has a way back.
  2. Read before you write. The Flight Recorder and Lost Work are both read-only. Establish what moved, and when, before changing anything.
  3. Prefer the narrowest restore that fixes it. A capsule restores per domain. If the only thing wrong is a branch pointer, restore refs and leave the index and working tree alone.
  4. Let Doctor repair what it has a recipe for. Every repair takes a capsule first, and there is no control that waives it.
  5. Recover lost commits to a new branch. Lost Work’s recovery runs one command, creates a new name, and touches nothing else: no checkout, no reset, no index change.

Where the data is

All of it is on this Mac. Nothing is uploaded anywhere.

Recovery data locations
WhatWhere
Capsules and checkpoints~/Library/Application Support/dev.gitaegis.app/aegis/capsules/<repository-id>/<capsule-id>/
Flight Recorder timelinethe flight_events table inside ~/Library/Application Support/dev.gitaegis.app/aegis/app.db
Recovery refs left in your repository<repository>/.git/refs/aegis/
Repository catalogue, operation journal, capsule index~/Library/Application Support/dev.gitaegis.app/aegis/app.db

<repository-id> is GitAegis’s internal identifier for the repository, not its path. A capsule directory name starts with cap- for a standard capsule and chk- for a light checkpoint.

The refs GitAegis leaves in your repository

Before a force push and before a merge- or rebase-abort repair, GitAegis writes an ordinary ref under refs/aegis/ pointing at the tip it is about to leave behind. It never garbage-collects them. You can read them with Git alone, with GitAegis closed:

zsh
cd /path/to/repository
git for-each-ref --format='%(refname) %(objectname:short) %(contents:subject)' refs/aegis/

They are refs like any other, so git show, git log and git branch <name> <ref> all work on them.

If none of this recovers your work

Generate a support bundle from Doctor → Export. It is written to a file on your disk and transmitted nowhere; sending it is your action, in your own mail client. Secrets are scanned for and redacted before the file is written, and the redaction count is reported back to you. Path redaction is a separate choice, off by default, because a worktree finding whose whole content is a path says nothing once the path is gone.

Send it privately. A support bundle carries repository structure and environment detail, so it does not belong on a public issue tracker.

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.