git操作:撤销更改的文件
程序员文章站
2023-11-08 10:45:10
在没有git add之前:
#撤销所有更改
git checkout .
#撤销指定文件的更改
git checkout -- myfile.txt
......
在没有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 返回到某个节点,保留修改
下一篇: jquery实现可拖拽弹出层特效