git checkout -- xx 报错
程序员文章站
2022-07-15 16:31:11
...
想要使用git checkout -- UserDaoTest.java 命令将版本区的代码替换工作区的代码
使用git checkout -- UserDaoTest.java 出现了以下错误:
error: pathspec 'UserDaoTest.java' did not match any file(s) known to git.
原因是将UserDaoTest.java 已放到缓存区,所以在版本区中匹配不到
解决办法:
1. git rest HEAD UserDaoTest.java 将缓存区的代码撤销
Unstaged changes after reset:
D src/main/java/UserDaoTest.java
2. git checkout -- UserDaoTest.java 将版本区的代码替换工作区的代码
推荐阅读
-
记录微信小程序报错 Unexpected end of JSON input;at pages/flow/checkout page getOrderData function
-
将用户A的视图查询权限赋予用户B报错,提示ORA-01720: grant option does not exist for ‘xx.xx’
-
git checkout 命令使用详解
-
小程序报错Do not have xx handler in current page的解决方法
-
git clone到本地是报错:fatal:out of memory malloc failed tried to allocate完美解决,我就是这样解决的,希望对你有用
-
git checkout -- xx 报错
-
git checkout -- xx 报错
-
SpringBoot报错:Missing URI template variable 'XX' for method parameter of type XX
-
Vue Git提交代码报错,Commit failed with error
-
git merge 报错:error: Your local changes to the following files would be overwritten by m