Chapter · Git

History, Inspection & Debugging

A repository is a searchable record of decisions. This chapter teaches you how to interrogate that record and recover when the shape of history surprises you.

Topics
Topic 1

Diff & Show

Reading changes at file, hunk, commit, branch, and staged-versus-unstaged levels.

Planned
Topic 2

Log Queries & Revision Syntax

Filtering history by path, author, time, message, ancestry, ranges, and commit selectors.

Planned
Topic 3

Blame & Archaeology

Tracing why a line changed while accounting for renames, formatting churn, and context.

Planned
Topic 4

Bisect

Binary-searching history to find the commit that introduced a regression.

Planned
Topic 5

Stash & Clean

Temporarily shelving work, restoring it safely, and removing generated or untracked files.

Planned
Topic 6

Reflog Recovery

Using reflog to recover lost commits, undone branches, hard resets, and other near-misses.

Planned
Topic 7

Reset, Restore & Revert

Choosing the right undo tool for files, commits, published history, and local experiments.

Planned
Topic 8

History Rewriting

Surgically rewriting committed history with git filter-repo — removing leaked secrets, extracting subtrees, restructuring repos.

Planned