git操作:撤销更改的文件,


在没有git add之前:

#撤销所有更改
git checkout .

#撤销指定文件的更改
git checkout -- myfile.txt

在git add之后:

git reset HEAD myfile.txt

git push 之后:

git reset --hard  comittHash
# git log --online可以查看hashid 返回到某个节点,不保留修改

git reset --soft  comittHash
# git log --online可以查看hashid 返回到某个节点,保留修改

相关内容

    暂无相关文章