I recently wanted to, as I thought, update my code on the remote git repository. I didn't realize it's not even committed yet. I did create some errors, so I wanted to reset the branch to its previous state.
As you may expect, I used git reset --hard
.
Well, everything (the whole project) has been gone ever since; except the .gitignore
files/folders, of course. I've been wondering, is there any way to undo that?
The only steps I did:
git add .
# Here I realized there is a bug in what I did
# I thought myself it would be better to undo that as it wasn't even something needed
git reset --hard
Also, I'd like to point out it's probably not a duplicate of any question here as others have had some commits before. That's completely new repository, and it's been "reset hard".