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

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 pruneorgit 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
HEADcannot 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.
| What happened | Where to look |
|---|---|
| An operation you ran in GitAegis went wrong | Doctor (⌘5) → Capsules. The capsule taken before that operation is the way back, domain by domain. |
| A branch moved and you do not know why | Doctor → 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 stash | Doctor → 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 merge | Doctor → Overview, then Run health scan. Read the finding’s evidence before applying its repair. |
| The app stopped while an operation was running | The operation is reconciled to requires-intervention at the next launch. Read “After a crash”. |
| Work that was never committed at all | Only a capsule can hold that. Lost Work searches the object database, and uncommitted content was never in it. |
The order to work in
- Capture the current state. Create a capsule. Whatever you do next now has a way back.
- Read before you write. The Flight Recorder and Lost Work are both read-only. Establish what moved, and when, before changing anything.
- 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.
- Let Doctor repair what it has a recipe for. Every repair takes a capsule first, and there is no control that waives it.
- 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.
| What | Where |
|---|---|
| Capsules and checkpoints | ~/Library/Application Support/dev.gitaegis.app/aegis/capsules/<repository-id>/<capsule-id>/ |
| Flight Recorder timeline | the 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:
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.