在没有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 返回到某个节点,保留修改
如对本文有疑问, 点击进行留言回复!!
linux下文本编辑器vim的使用方法(复制、粘贴、替换、行号、撤销、多文件操作)
网友评论