Nicolae Focsa
Nicolae Focsa

Reputation: 55

Is it possible to bring back not staged changes after git reset --hard HEAD@{1}?

After a pull request, git showed a long list of staged files which I have not modified. enter image description here

Then I've made the stupid decision to execute git reset --hard HEAD@{1} and lost the not staged changes. Is there a solution to bring them back?

Upvotes: 1

Views: 47

Answers (1)

Gonzalo Matheu
Gonzalo Matheu

Reputation: 10084

I think there is not way to recover unstaged modified files.

Although you might want to look to your text editor history/undo files. More than once I recovered deleted files from there.

To revert a conflicting merge is safer to do a git merge --abort.

Upvotes: 2

Related Questions