Unfortunately I did several times git reset --hard HEAD^ losing a quite big chunk of code in several files. Is there a way to restore those commits or in this case to forward where the HEAD was before, so I can bring up those lines that I lost?
Unfortunately I did several times git reset –hard HEAD^ losing a quite big chunk
Share
Use the reflog to recover the sha1 of the previous HEAD. In particular, the article reflog, your safety net will be particularly relevant to you. From that article:
Once you have found the sha1 of the commit you want to go back to, use something like: