折腾:
期间,想要删除git的rebase的那一系列的操作
恢复到和服务器一致的版本
git remove local changes
bash – Various ways to remove local Git changes – Stack Overflow
去试试:
<code>licrifandeMacBook-Pro:crifanLib crifan$ git reset --hard HEAD is now at 01b597d Merge branch 'master' of https://github.com/crifan/crifanLib licrifandeMacBook-Pro:crifanLib crifan$ git status On branch master Your branch is ahead of 'origin/master' by 3 commits. (use "git push" to publish your local commits) nothing to commit, working directory clean licrifandeMacBook-Pro:crifanLib crifan$ </code>
即可:
丢弃所有的改动,恢复到最新版。
【总结】
本地的丢弃改动,直接用:
<code>git reset —hard </code>
即可。
转载请注明:在路上 » [已解决]git中如何丢弃本地的改动