Information Technology Reference
In-Depth Information
The command
$ git checkout HEAD
∼
-- lorem.txt
restores a deleted
file from the next-to-the-last revision. If you edit the file, its state will be indicated by
AM.
Summary
This chapter divided all the files stored in the repository into several categories. The di-
vision started with the question: whether the file was tracked by git. Every file is either
untracked
or
tracked
. Because git doesn't store any information about untracked
files—nothing more can be said about them.
Tracked
files can be further categorized as
unmodified
and
modified
.
Unmodified
files are files that have already been stored in the repository (i.e., in the
database). They have not been modified since then.
Modified
files are the files that have been changed after they have been committed.
They can be further divided into
staged
and
unstaged
files.
Staged
files are files that will go into the next revision, while
unstaged
files will re-
main unchanged. Unstaged files are not influenced by nor will they influence the next
commit command.
Figure 4-8
presents the diagram of the states of files discussed.