- 工作区放弃更该
git checkout -- file
git checkout -- .
- 暂存区回到工作区
git reset HEAD file
git reset HEAD .
- 回滚某次commitId
git reset --hard commitId
- 回滚,已经push到远程仓库的
git reset --hard commitId
git push origin master -f
git 使用
最新推荐文章于 2025-01-10 16:13:50 发布
git checkout -- file
git checkout -- .
git reset HEAD file
git reset HEAD .
git reset --hard commitId
git reset --hard commitId
git push origin master -f