Sometime you can delete a file ,by accident, and then you commit your changes . after a while you recognize that you need this file So what you can do ??
what I have tried to resolve such problem (there are several ways) is this few steps :
- List all files that have been deleted from my git repository :
git log --diff-filter=D --summary
- Search the commit where you deleted your file
- undo your commit to the searched one BUT don't lose your modifications by taping this cmd :
git reset --soft HEAD~n
n: is the number of undo commit steps - if you type git status you will re-view your deleted file so to get the file back type this cmd :
git checkout -- [file name]
Aucun commentaire:
Enregistrer un commentaire