0

I've initiated new local git repository and added some files but there were some files that shouldn't be, so I typed git reset --hard and then all added files disappeared. I haven't done any commit on this repository yet. There is any way to recover my files? I tried to git checkout . and git checkout <filename> but both returns error: pathspec '' did not match any file(s) known to git.

wjandrea
  • 23,210
  • 7
  • 49
  • 68

2 Answers2

0
  • Since you not commit any file, So you not able to recover that file.
  • Solutions is that you recover file from recycle bin / trash. if you delete from bin also. Then use third party tool like EaseUs.
Ashish Sondagar
  • 591
  • 1
  • 4
  • 10
0

try this and its work works only if files have not committed and pushed, once i have same problem it worked for me

git checkout your-deleted-file-path
Faisal
  • 223
  • 1
  • 18