当前位置: 移动技术网 > 科技>操作系统>Linux > git操作:撤销更改的文件

git操作:撤销更改的文件

2019年08月06日  | 移动技术网科技  | 我要评论

在没有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 返回到某个节点,保留修改

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网