Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redo "Git Reset --hard HEAD^" Command [duplicate]

Tags:

git

git-reset

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

I used the command line:

git reset --hard HEAD^

how can i redo it ?

like image 413
Ramin Mousavi Avatar asked Aug 28 '26 02:08

Ramin Mousavi


1 Answers

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.

like image 177
manojlds Avatar answered Aug 29 '26 19:08

manojlds