How to un-delete / recover local files from git pull?
Scenario:
- I have local files in a folder
- I do git init
- “git pull https://..” from server
- All the local files is deleted
Can I get my deleted files back?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the lost files were never staged or committed, there is no way to restore them using git. At this point, the only thing you can do is try to restore them using third-party undeletion utilities written for your OS.
(In my tests git doesn’t delete local files at a
git pull, but at this point how the files got deleted is not relevant to the question, only to git’s reputation for not deleting user data.)