It seems I somehow deleted some files in a folder, and I can’t remember their names etc.
Is it possible to list all files that have ever been created in a given folder?
e.g.
/db/scripts/
I then want to view the file if I deleted it.
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.
Git only knows about files that were committed, it doesn’t keep track of random files. If the files were previously committed, AND you didn’t commit the deletes, then simply typing
git statuswill show you the files that are missing from the repo.If you did commit the delete, you type
git log --name-statusto see which files have been modified when.Once you find the commit, to view the file you can either do
to see the diff, or
and view it howerver on the filesystem. Note that if you do the second command, you won’t be on a branch anymore, so you will have to do
git checkout master(or your previous branchname) to get back to your old state.