0

I was working on my project, and I made a wrong commit (the last commit) and wanted to permanently delete it from the git logs, and I did the following command:

git reset --hard HEAD^

The problem is that I didn't make add on my changes, so all changes which are unstaged were deleted.

Now, how do I get all the changes back?

3

1 Answer 1

2

As the git documentation specifies:

git reset
--hard Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.

If there is no restore source (stash, add, commit) I know of no way to restore your files since git doesn't 'auto-updates' a current snapshot of your working tree

Not the answer you're looking for? Browse other questions tagged or ask your own question.