The checked out file will overwrite not yet commited changes you did in this file.
This command will check out the file
file.example (which is located in the directory
path/to/) and overwrite any changes you might have made to this file.
git checkout some-branch path/to/file
You have to add
-- before the path if your file could be mistaken for a file (optional otherwise). No more options can be supplied after the
git checkout some-branch -- some-file
some-file is a file in this example.