I have a repo in which a number of files are committed.
I checked out an older revision of a particular file (without making a branch).
In all git tutorials there are visual explanations with pictures such as
A B C D
*--*--*--* <-- master <-- HEAD
describing how a particular file has changed.
Now check out B, giving Detached Head
A B C D
*--*--*--* <-- master
^
\-- HEAD
( Acknowledgement, ascii art taken from Brian Campbell post Checking out an old commit and maintaining the head on the master branch? )
I see that this is an accurate situation for the particular file. However, I believe the other files in the repo are still latest version, since an old revision of only one file was checked out.
The question: how can a single HEAD be valid for all the files in a folder, including some that are more recent than the commit referred to by the HEAD. Should there be one HEAD pointer per file?
In typing this question, I am now guessing that maybe the HEAD concept applies to the local (or remote) repo and has nothing to do with the working directory. So the fact that most of the files in the working directory are newer than HEAD is "just the way it works".