This should work:
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
You should also look at VonC‘s answers to some related questions:
- How to retrieve a single file from specific revision in Git?
- How to get just one file from another branch
UPDATE 2015-01-19:
Nowadays you can use relative paths with git show a1b35:./file.txt
.