GitHub Command Center
v3.82.0Complete User Guide
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

  1. Stop touching anything.
  2. Open GCC and choose Recover.
  3. Select the repo and the branch you were working on.
  4. Open Reflog and filter to your author.
  5. 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

AccidentWhere GCC helpsWhat you should see
Bad reset --hardReflogYour previous tip appears as the reflog entry before the reset.
Stashed and forgotStash workbenchEvery stash entry with its diff and conflict preview.
Detached HEAD workCheckout recoveryDetached list and the commits made while detached.
Lost after rebaseRebase reflogThe 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.