-2

by running this command my all files/folder consisting git init are gone.I run this command in my ubuntu terminal git reset --hard origin/master and following was the response obtained HEAD is now at 979997c Initial commit but when I run git log only the initial commit with 979997c commit id is visible

I am in tension whether all my files are gone...Is there any way to get back all the files.. Please help..Please help me out of this since all the projects I did are in this folder

Suraj Palwe
  • 2,080
  • 3
  • 26
  • 42
  • As a side note, it's probably best if you have an individual repository for each project as opposed to keeping all of them in one repository – taylorc93 Feb 21 '15 at 16:56
  • I had one workspace followed by different projects!! – Suraj Palwe Feb 21 '15 at 16:57
  • possible duplicate of [How to recover last commit after git hard reset?](http://stackoverflow.com/questions/19898557/how-to-recover-last-commit-after-git-hard-reset) – Andrew C Feb 21 '15 at 19:05

1 Answers1

2

Run git reflog and find the commit before you reset to 979997c.

Say that commit has id 1234567, run git log 1234567 to verify it's correct, and then re-reset the branch with git reset --hard 1234567.

Christoffer Hammarström
  • 27,242
  • 4
  • 49
  • 58