Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo "git reset --merge"

I just did:

git reset --merge

and I lost my latest modifications to some files, how do I undo this last action?

like image 843
dennisbot Avatar asked Oct 07 '12 00:10

dennisbot


1 Answers

you can look at your reflog to find the commit at wich you were before:

git reflog

Once you find your previous commit, copy the sha-1 hash and

git reset <commit sha-1> --hard

Although, if what you lose was uncommitted modifications, well then they're lost.

like image 93
Simon Boudrias Avatar answered Sep 28 '22 07:09

Simon Boudrias