I would like to restore a file that I deleted within a commit. I tried
git checkout path/to/deleted/file
but got
error: pathspec 'path/to/deleted/file' did not match any file(s) known to git.
How can I restore a file deleted by my latest commit?
I would like to restore a file that I deleted within a commit. I tried
git checkout path/to/deleted/file
but got
error: pathspec 'path/to/deleted/file' did not match any file(s) known to git.
How can I restore a file deleted by my latest commit?
 
    
    Also specify the last commit where the file was still present.
git checkout <commit> path/to/deleted/file
