After the last commit, I modified a bunch of files in my working copy, but I want to undo the changes to one of those files, as in reset it to the same state as the most recent commit.
However, I only want to undo the working copy changes of just that one file alone, nothing else with it.
How do I do that?
You can use
You can do it without the
--(as suggested by nimrodm), but if the filename looks like a branch or tag (or other revision identifier), it may get confused, so using--is best.You can also check out a particular version of a file:
More details included based on comments
First check the the commits of the file
Then you can run this
where the sha-reference is a reference to the sha of a commit, in any form (branch, tag, parent, etc.