总结
一般来说未push 就用reset ,已push用revert
未commit
git checkout -- readme.txt
已commit未push
如何撤销?
撤销到上一个版本
git reset --hard HEAD^
已push
删除最后一次远程提交
git revert HEAD
git push origin master
回滚某次提交
git revert commitID
https://blog.youkuaiyun.com/ligang2585116/article/details/71094887
https://blog.youkuaiyun.com/Ginny_2017/article/details/89353221
博客主要介绍了Git不同提交状态下的操作方法。一般未push时用reset,已push用revert。具体涵盖未commit、已commit未push时如何撤销到上一版本,以及已push时删除最后一次远程提交和回滚某次提交的相关内容,还给出了参考链接。
1274

被折叠的 条评论
为什么被折叠?



