git commit之后未submit,rebase之后找不到自己代码的处理方法

今天使用sourceTree提交代码的时候,commit之后未submit,直接rebase主分支代码,完了发现自己本地做的修改都没了,且远程没有本地分支。google之后发现有一个简单方法可以恢复到本地commit版本,具体方法如下,在命令行执行:
 
git reflog
# Suppose the old commit was HEAD@{5} in the ref loggit
reset --hard HEAD@{5}
 
还是太菜了,要学习的东西还有很多,呜呜~
原文地址:https://www.cnblogs.com/lxd2502/p/5787550.html