I messed up with one file in one repository and want to check out only that file back to a commit. How to achieve this?
To check the file with
my_file.name at git commit
$ git checkout commit_sha1 my_file.name
You can also use the relative commit instead of
commit_sha1 such as
master^ and etc.
To check back (the master) of myfile.name:
$ git checkout master my_file.name