What's the difference between git reset file and git checkout file?

Viewed 4187

Why is it that git allows me to reset a file? I thought I understood reset, in the sense that it was moving the HEAD ... clearly I was wrong.

So, git reset sha file seems to do the same as git checkout sha file, with the exception that I see file in the index and in the working directory.

It doesn't make sense to me. Can someone please explain the difference?

2 Answers
Related