Git Made Crystal Clear · chapter 3: Core Concepts: The Three Trees and the Object Model
The three trees: work moves forward with add and commit, and back with restore and switch
2026-08-27
Work flows forward with two commands. git add copies changes from the working directory into the index. git commit records whatever is in the index as a permanent snapshot in the repository. Work also flows backward: git restore pulls a file from the index (or a commit) back into the working directory, and git switch moves you between committed states.

This diagram is one of many in Git Made Crystal Clear.
Every chapter opens with the gist, draws the hard ideas, and ends with recipes and sources.
Get the book

