| English | 中文 |
This directory is used for handling high-frequency Git accidents. First, determine the state, then choose a recovery plan; do not copy dangerous commands right away.
It serves the “complete an engineering change” layer of the knowledge map and owns incident preservation and recovery choices. Afterward, return to the change path to strengthen scope, review, and validation.
The answers to these three questions determine whether you can rewrite history, whether you should use revert or reset, and whether you need to confirm with the team first.
| Current State | Recommended Entry |
|---|---|
| Code not yet committed | Undo Anything |
| Committed, not yet pushed | Git Troubleshooting Playbook |
| Pushed | Git Troubleshooting Playbook, Revert Merge Commit |
| Used as a base for further development by others | Git Troubleshooting Playbook |
| Secret has been committed | Remove Secret from History |
| Force push overwrote remote | Recover Force Push |
| Problem I’m Facing | Recommended Reading |
|---|---|
| Unsure how to recover | Git Troubleshooting Playbook |
| An agent edited, deleted, or left a worktree | AI Agent Incident Recovery |
| Committed to the wrong branch | Committed to Wrong Branch |
| Want to undo an operation | Undo Anything |
| Cannot find a commit | Recover Lost Commit |
| Force push overwrote remote | Recover Force Push |
| Discovered an incorrect merge | Revert Merge Commit |
| Conflict resolution is messed up | Resolve Conflicts |
| Secret committed into history | Remove Secret from History |
git status, git log --oneline -10, git reflog -10revert on public branches