3

Possible Duplicate:
Undoing a git reset --hard HEAD~1

I used the command line:

git reset --hard HEAD^

how can i redo it ?

1
  • yes i mean undo, i used git reset --hard HEAD~1 and worked, thanks Commented Nov 1, 2011 at 19:51

1 Answer 1

9

If you want to go back to HEAD ( the previous ) you can do:

git reset --hard HEAD@{1}

Note that working directory changes and staged changes are lost after you do git reset --hard and you cannot get them back.

1
  • 2
    Also: take a look at git reflog.
    – poke
    Commented Nov 1, 2011 at 19:50

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