Git撤销修改

以 hello.txt 为例

情况一:

没有添加到暂存区的撤销方法:

用 以下命令即可撤销完成:

git checkout -- hello.txt

情况二:

添加到暂存区后的撤销方法:

1.1 先取消暂存

git reset HEAD hello.txt

1.2然后撤销修改,用命令

git checkout -- hello.txt

撤销完成。

情况三:

同步到了远程仓库:

自求多福吧。

 

posted @ 2018-11-25 13:41  HiCYP  阅读(164)  评论(0编辑  收藏  举报