user13107
user13107

Reputation: 3489

How to undo git mixed reset?

I ran below command in my working directory.

git reset

It printed names of some files like

M /path/to/file

From What does 'git reset' command do without any option? I understand that git reset = git reset --mixed HEAD

How do I undo the above operation?

Upvotes: 4

Views: 5991

Answers (1)

cexbrayat
cexbrayat

Reputation: 18442

If you just did 'git reset' you have just unstaged your files, but you still have your modifications in your working directory. So you didn't lose anything, nor changed anything as you reset to HEAD.

Even if you had done a 'git reset HEAD~2' for example, which would have change your working directory, you could still use the reflog to recover, as explained in this question

Upvotes: 6

Related Questions