You can use Git's reflog feature, which is a sort of audit trail of all the things which happen as you use Git, including commits.
git reflog --date=iso
Try to find an entry looking something like the following:
b28ae3b HEAD@{2016-11-25 15:54:53 +0800}: commit: message for the commit which you
made earlier today
If you can find the commit, record the SHA-1 hash ( b23ae3b
in this example) because you will need it to restore your branch at that commit. Now restore your branch via the following:
git checkout yourBranch
git reset --hard b28ae3b
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.