0

I have missed one file locally but I can recall I commit and push that file before into the repository.

Can anyone help to get/search that commit base on my file name, so do I can go and get that file again.

4

1 Answer 1

0

Try with the following instruction:

git log --all --full-history --oneline -- {{YOUR_FILE_NAME}} **/{{YOUR_FILE_NAME}}

So you can find the file name in the project history if it were on the root folder, or in any subfolder.

Please tell me if that works for you.

3
  • thanks for response, I tried but it does not work out for me Commented May 24, 2021 at 13:25
  • What's the output your received from the above command? Commented May 24, 2021 at 13:30
  • no console output, command executed with no error Commented May 24, 2021 at 13:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.