Recover from accidental git reset
Simply git reset HEAD@{1}
If you did a hard reset then git reset HEAD@{1} --hard
If you did a soft reset then git reset HEAD@{1} --soft
etc..
Note
If you did a hard reset then you cannot recover un-commited changes which you originally had (unless you stash frequently for backups).
Written by Kristian Lewis Jones
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#