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
  • 28,235
  • 9
  • 60
  • 81
Daniel512
  • 11
  • 1

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
  • 917
  • 1
  • 9
  • 16
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
Astronaute
  • 219
  • 3
  • 19