Quickly fix a commit message you wrote incorrectly without losing your work.
Recover accidentally deleted branches or commits that seemed lost forever.
Find and remove sensitive data like passwords you committed by mistake.
Undo a merge or rebase that went wrong and get back to a working state.
Git Flight Rules is a practical reference guide for handling common and not-so-common problems you encounter while using Git, the version control system. The name comes from the aviation industry, where "flight rules" are detailed, scenario-specific procedures recorded over decades of real incidents, step-by-step guides for what to do when something goes wrong. The author applies the same concept to Git: a cookbook of situations and their exact solutions. The document is organized entirely around specific problems rather than Git concepts. Each section title is phrased as a real scenario a developer might face: "I wrote the wrong thing in a commit message," "I accidentally committed sensitive data," "I pulled from the wrong branch," or "I need to undo changes I accidentally staged." Under each heading you find the exact Git commands to fix the situation, with brief explanations of what each command does and why. Topics covered include editing recent and historical commits, managing staged and unstaged changes, branch operations, merging and rebasing, handling submodules, managing remotes, tracking down bugs with bisect, and recovering from situations that seem irreversible like accidental hard resets. The guide is written as plain documentation, no installable software, no code libraries. Someone would use this repository when they have made a mistake in Git and need to fix it quickly without having to understand every underlying concept from scratch. It is especially valuable for developers who use Git daily but encounter edge cases they haven't memorized, the format is designed for looking up the exact solution to a specific problem at the moment you need it. The guide requires no particular tech stack, it is plain Markdown documentation covering standard Git command-line usage.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.