git show branch:file
Where branch can be any ref (branch, tag, HEAD, ...) and file is the full path of the file. To export it you could use
git show branch:file > exported_file
A simple, newbie friendly way for looking into a file: git gui browser <branch>
which lets you explore the contents of any file.
It's also there in the File menu of git gui
. Most other -more advanced- GUI wrappers (Qgit, Egit, etc..) offer browsing/opening files as well.
参考博文