I understand git reset
updates the index, whereas git checkout
updates the working copy. What I don't understand is the use case that requires git reset
to accept an argument for reference and path? It seems I would always want to use git checkout
in this case?
This comes up all the time when folks ask why they can't git reset some-ref --hard -- some/path/to/file
. The real question is why git reset
even accepts git reset some-ref -- some/path/to/file
when we have git checkout
.
Never thought of this till teaching someone the difference between the two.