报错:

D:\git-root\test>git reset --hard HEAD^ More? More? fatal: ambiguous argument 'HEAD ': 
unknown revision or path not in the working tree. Use '--' to separate paths from revisions,
like this: 'git [...] -- [...]'

 

原因:

^是cmd.exe的escape字符,属于特殊字符。

 

修正:

命令里要用到文字 ^ 时用双引号扩起来即可。

git reset --hard HEAD"^" 
git reset --hard "HEAD^" 

 

相关文章:

  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-06-09
  • 2021-10-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-07-12
  • 2021-11-27
  • 2021-07-15
相关资源
相似解决方案