title: Is there way to recover files ignored via .gitignore in the first commit?
body: <p>I have a local repo. I made the mistake of adding a .gitignore file before the first commit with all the code. After adding the .gitignore file, the only files left in my repo are the ones that I wanted to ignore, that is the ones that matched my .gitignore file.</p>
  
  <p>Tracing back the steps:</p>
  
  <ul>
  <li>I had a folder.</li>
  <li>I ran <code>git init .</code></li>
  <li>I added a regular Python <code>.gitignore</code> file.</li>
  <li>I then commited adding the <code>.gitignore</code> file.</li>
  <li>After this, the only files left in my directory are those who my <code>.gitignore</code> file was supposed to be ignoring. Confusing?</li>
  </ul>
  
  <p>Is there a way to recover the files which were ignored in the first commit of my repo?</p>
  
  <p>Below is a screenshot after running <code>git reflog</code></p>
  
  <p><a href="https://i.stack.imgur.com/WyPJw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WyPJw.png" alt="enter image description here"></a></p>
  
  <p>Thanks in advance</p>