報錯:
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^"