Git bisect and reflog: find the bad commit, recover lost work

11 steps · about 2 h 57 min · Intermediate

  1. LearnGitBranching: an interactive git visualization and tutorial (interactive, Peter Cottle / GitHub, 45 min)

    Seeing commits as a graph of pointers makes both bisect's midpoints and reflog's recovery easier to understand.

  2. A beginner's guide to GIT BISECT - The process of elimination (article, Metal Toad, 10 min)

    It explains in plain English why bisect is fast: it is binary search over your history.

  3. Use Git Bisect to Find the Commit That Introduced a Bug (article, Mokkapps, 10 min)

    A step-by-step manual bisect session with start, good, bad and reset.

  4. Find the Git commit that introduced a bug - 30 seconds of code (article, 30 seconds of code, 5 min)

    A compact cheat sheet comparing manual bisecting with git bisect run.

  5. Git Bisect Example: How to Find the Exact Buggy Commit (article, Icinga, 10 min)

    A worked example that ends with the first bad commit, plus the exit-code 125 skip trick.

  6. Git Bisect: Finding the Commit That Broke Your Code - TeachMeIDEA (article, TeachMeIDEA, 20 min)

    It covers automating bisect with test scripts and handling merge commits and broken builds.

  7. Git - git-bisect Documentation (doc, git-scm.com, 25 min)

    The official reference for the full details: terms, skip, run, and merge handling.

  8. Git Reflog Explained: Recover Deleted Commits & Lost Work (article, DEV Community, 10 min)

    It starts the reflog half with the classic case: recovering from an accidental reset --hard.

  9. Recovering Lost Commits with Git Reflog (article, OpenReplay, 12 min)

    It sets out what reflog can and can't recover, how long entries last, and when to use git fsck.

  10. Lose a Commit, Get it Back (tutorial, Educative, 15 min)

    A hands-on repo setup where you lose a commit and get it back yourself.

  11. Git - git-reflog Documentation (doc, git-scm.com, 15 min)

    The official reference for HEAD@{n} syntax, expiry and the reflog subcommands.