Reputation: 107
I had committed my changes on the local and then did accidentally did a checkout from remote branch and have lost all my changes! Help - is there anyway I can get back to my committed changes?
Upvotes: 0
Views: 177
Reputation: 301037
Since you have committed your changes, you need not worry. Just do this:
git checkout -
it will take you back to the branch you were in.
Upvotes: 1
Reputation:
Fixing un-committed mistakes
If you've messed up the working tree, but haven't yet committed your mistake, you can return the entire working tree to the last committed state with
$ git reset --hard HEAD
Upvotes: 0