Recovery
Recovery playbook: when the commit you need is suddenly invisible
GCC’s recovery lane exists because Git almost never deletes, but it hides very well. This page is the sequence to follow before panic sets in.
The 60-second triage
- Stop touching anything.
- Open GCC and choose Recover.
- Select the repo and the branch you were working on.
- Open Reflog and filter to your author.
- Look for the action that moved your pointer: reset, checkout, rebase, merge or stash.
Reflog first, dangling objects second
Reflog is your time machine for branch pointers. If you cannot find the commit there, run the dangling-object scan; it can surface objects no branch references anymore.
The four classic accidents
| Accident | Where GCC helps | What you should see |
|---|---|---|
| Bad reset --hard | Reflog | Your previous tip appears as the reflog entry before the reset. |
| Stashed and forgot | Stash workbench | Every stash entry with its diff and conflict preview. |
| Detached HEAD work | Checkout recovery | Detached list and the commits made while detached. |
| Lost after rebase | Rebase reflog | The pre-rebase tip before the rewrite. |
Hotfix cognition under stress
When a production issue is live, never rehearse recovery steps for the first time. GCC’s preview lines show the exact object IDs involved; read them aloud to a teammate before executing the repair.
Never run garbage collection (git gc) while in panic recovery mode. It can make already-unreachable objects impossible to find.