Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>There are no commits, so I can't just revert/pull the files (there was only a local copy)</p> </blockquote> <p>and</p> <blockquote> <p>Is it possible to get those files back?</p> </blockquote> <p>The answer is <strong>no</strong>. </p> <p>There are no commits, hence you are not using source control. </p> <p>The files never entered the object database. In general, you can never get uncomitted stuff back in git. You can most often get previously committed stuff back. </p> <h3>Rule of thumb: commit often</h3> <p><strong>Edit</strong></p> <p>See also </p> <ul> <li>my own answer here <a href="https://stackoverflow.com/a/6780036/85371">https://stackoverflow.com/a/6780036/85371</a> (look for other sources of backup) and</li> <li>someone else's answer <a href="https://stackoverflow.com/a/6780036/85371">https://stackoverflow.com/a/6780036/85371</a> two months later.</li> </ul> <blockquote> <p><em>I accidentally ran <code>git reset --hard</code> on my repo today too while having uncommitted changes too today. To get it back, I ran <code>git fsck --lost-found</code>, which wrote all unreferenced blobs to <code>&lt;path to repo&gt;/.git/lost-found/</code>. Since the files were uncommitted, I found them in the <code>other</code> directory within the <code>&lt;path to repo&gt;/.git/lost-found/</code>. From there, I can see the uncommitted files, copy out the blobs, and rename them.</em></p> <p><em>Note: This only works <strong>if you added the files you want to save to the index</strong> (using <code>git add .</code>). If the files weren't in the index, they are lost.</em></p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload