Using git checkout with a path but without specifying a commit will check out the file from the index, i.e. the staging area. So for example if you have staged some changes to a file, and then modified it further and only want to undo those additional changes, then you can use git checkout -- some/path to undo those changes.
If your index is clean, i.e. nothing is reported as being staged when using git status, then the index will be equivalent to HEAD, the currently checked out branch (or commit). So this is a way to undo changes too.
Of course specifying a commit with git checkout will always use the file version from that exact revision, regardless of your index.
git checkout -- index.html, with the space, orgit checkout --index.html, without the space?