The easiest way to do this is to simply check the version using the hash of the file you want, or change and go back.
Use gitkto find the commit hash that interests you.
Then you can use git checkout hashhere. This will return your entire repository to this hash.
If all you need is a specific file, use git checkout hash filepath.
For instance:
git checkout 4fda14eefe0388e836aac8feaca68ab18bfad6b1 path/to/file.c
, , - , git show , git show hash:filepath , :
git show 4fda14eefe0388e836aac8feaca68ab18bfad6b1:path/to/file.c > savetohere.txt
tree-ish, :
git show master~2:path/to/file.c > savetohere.txt
: "2 , path/to/file.c savetohere.txt".