Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to restore deleted file [duplicate]

Possible Duplicate:
Restore a deleted file in a Git repo

How do I restore a file I accidentally removed from my git repository? I know this is a trivial question, but I haven't found the answer in the documentation.

like image 721
Steve Emmerson Avatar asked Dec 03 '09 22:12

Steve Emmerson


People also ask

Can duplicate files be deleted?

In Windows, you can delete duplicate files in two ways: manually or using duplicate file removal software.

Can I delete duplicate files in drive?

You can see the number of duplicate files, empty folders, large folders and more that are taking up space in your Google Drive account. Then each month, you can delete up to 100 files and folders.


1 Answers

git checkout <commit> <path>

Commits may be specified directly by SHA1, or via a branch or tag. Make sure that the represents the state of the repository when the deleted file was still present. If the commit argument is omitted, the currently checked out commit (HEAD) will be used.

like image 100
wulfovitch Avatar answered Sep 23 '22 00:09

wulfovitch