首先git checkout -- filename 恢复成的是暂存区版本 而不是版本库的版本

git add filename 将工作区文件添加到暂存区
git commit -m "explain"将暂存区所有修改同步到版本库
也就是说如果想同步版本库版本,要先用git reset HEAD <filename>将暂存区同步成版本库的版本 然后再用checkout命令
git checkout <filename>命令针对工作区
git reset HEAD filename命令针对暂存区(git restore <file>好像也是一样的作用)
相关文章:
-
2021-10-15
-
2022-12-23
-
2022-12-23
-
2021-09-17
-
2021-07-26
-
2021-12-20
-
2022-12-23
猜你喜欢
-
2021-04-22
-
2021-08-12
-
2021-10-24
-
2022-02-25
-
2022-01-28
-
2022-12-23
相关资源
-
下载
2023-02-12
-
下载
2023-02-02
-
下载
2023-01-17