Git is your lifesaver if you have deleted a file somewhere in the past and committed that change.

Due to the nature of Git that file is not gone, but just hidden.
You can retrieve that file by using “checkout”.

You should select the commit before the file got deleted or you’ll see an:

error: pathspec '<your-file-to-retrieve>' did not match any file(s) known to git.

So, suppose your commit is at 48b8bc and you want to retrieve some-file.txt:

git checkout 48b8bc -- some-file.txt

Now the file you were looking for should be in your new files when checking it with: “git status”.