Git-04-本地仓库撤销修改




编辑修改了文件,但是还没有git add之前

直接用 git checkout -- filename 这个命令就可以了

image-20210804093211941



已经 git add 了,但是没有 git commit 之前

1 模拟git add

image-20210804093328508


2 git reset HEAD file可以把暂存区的修改撤销掉(unstage),重新放回工作区

image-20210804093359271


3 git checkout -- filename撤销

image-20210804093438399



已经 git commit 了,但是没有推送到远程库

直接版本回退
回退方法:https://www.cnblogs.com/lichengguo/p/15090250.html

posted @ 2021-08-04 09:36  李成果  阅读(324)  评论(0编辑  收藏  举报