This is not very pleasant, since it will not receive the correct executable state of the file, but when pressed, you can do:
git show HEAD:targetfile > targetfile
Ideally for git checkout HEAD -- targetfile
you need to have the --working-tree-only
option, but I don't know anything about that.
source share