Tuesday 3 December 2013

Git: Undo git reset


#You have done wrong head reset ,don't worry. you we'll get the write code by using steps carefully :-

If you did something like
git reset HEAD~1
sometime you want to undo this. There is no need to cry, Git keeps a log of all ref updates.
To see them:
git reflog
The output may something like that
39ab761 HEAD@{0}: reset: moving to HEAD~1
b55c098 HEAD@{1}: Change skirt length ...
With
git reset HEAD@{1}
we undo our mistake and we are back at the commit before reseting.
Also possible:
git reset b55c098
 
 
note : do it very carefully 

No comments:

Post a Comment