I was working on a project recently where we had a config.json file that contained some credentials. We realized, that credentials should not be checked into version control and removed the file from the repository. Of course, if this ever happens to you, you should also roll your credentials. In our case the credentials never left our private gitlab instance and were only for a test server so we thought this was not a problem.

A couple weeks later I had cloned the repository again and was working on another branch when I needed those credentials again. Luckily, it was quite easy to find them again with the help of git:

git show master@{date}:src/config.json