When you run git checkout on a commit (specified by hash or ref) you're telling git to make your working directory look like how it did when the snapshot was taken.
git checkout
git
tree
commit
HEAD