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-09-10
Below: the paragraph from the book that builds this idea, then the diagram itself (Figure 3.1.), and a recap. About a minute of reading.
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.

Recap
- The idea: The three trees: work moves forward with add and commit, and back with restore and switch.
- The picture: Figure 3.1., from chapter 3 ("Core Concepts: The Three Trees and the Object Model") of Git Made Crystal Clear.
- Go deeper: the chapter builds this step by step, with recipes and sources at the end.
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


