Reputation: 551
Git is configured on my local machine. I used the following commands
git add .
git commit -m "message "
yesterday and forgot to push. I made several changes yesterday. Today due to some problem I am not able to push
. I don't know what happened today morning, but all my code went away.
Which commands do I need to get my code back?
Thanks
Upvotes: 2
Views: 993
Reputation: 1330102
If you have committed your code (which is now gone), you can check git reflog
.
It will list any unreferenced commit, for you to get back.
See for instance "Undoing git reset
?", or "how to undo a checkout in git?".
Upvotes: 5