i accidentally reverted commit 3 times instead of 2 using these command 
git reset HEAD~3
i wanted to do git reset HEAD~2
any way to undo git reset HEAD~3 ?
            Asked
            
        
        
            Active
            
        
            Viewed 27 times
        
    0
            
            
         
    
    
        Dhaval Lila
        
- 405
- 1
- 3
- 10
- 
                    Did you push the code to the remote? If No, then your changes are in local and you can check out to your current branch. – tsumit May 18 '18 at 09:46
- 
                    no i haven't pushed yet so what i do now exactly? – Dhaval Lila May 18 '18 at 09:46
- 
                    Possible duplicate of [How can I undo git reset --hard HEAD~1?](https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1) – Kasia Gogolek May 18 '18 at 09:47
- 
                    `git reset HEAD@{1}` this would help – tsumit May 18 '18 at 09:48
- 
                    git reset HEAD@{1} what it will do? – Dhaval Lila May 18 '18 at 09:49
- 
                    It will move the head to the recently pushed commit – tsumit May 18 '18 at 09:50
- 
                    hey it worked after doing git reset HEAD@{1} , I did git reset HEAD~2 and everything is back to normal. thank you. – Dhaval Lila May 18 '18 at 09:55