Many times we need to retrieve a single file from an older commit. The following command does that directly:
git checkout <commit_hash_value> <file_path_to_retrive>
You can also use HEAD references instead of a commit hash:
HEADgets the file from the latest commitHEAD^gets the file from one commit beforeHEADHEAD^^gets the file from two commits beforeHEADHEAD~10gets the file from ten commits behindHEAD