0

I'm completely new to Git. It's been a week since I made my first commit and I had a hard week completing my React project.

I tried to push my code again but I ran into some problems. I tried solving them using git reset --hard refs/original/refs/heads/master, but I'm not even sure that was the right one; I tried so many of them. Now I'm surprised my project had been deleted and I'm having only the files that I previously committed to my repo. What do I do?

Makoto
  • 104,088
  • 27
  • 192
  • 230
  • If you really did a hard reset, then all the work which was is your working directory and stage may be lost. If you are using a powerful IDE such as IntelliJ, then you may try using the local history to recover the changes to the files. – Tim Biegeleisen Aug 28 '19 at 00:59
  • I'm only using vs code is there an option like finding in recycle bin or so. I'm really feeling sick right now – youness toubella Aug 28 '19 at 01:01

1 Answers1

0

I saved my life use:

git reflog show

then choose the right Head, the one that corresponds to the desired commit message say for example HEAD@{3} finally run this git reset HEAD@{3} this is how I saved my life

more answers here