使用重置头恢复提交

问题描述 投票:0回答:1

当我尝试时,如何在一个存储库中:git reset head~1,这将删除最新的提交。在不同的存储库(github)上,它给我以下错误消息:

fatal: ambiguous argument 'head~1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
git github
1个回答
1
投票
git reset HEAD~1

HEAD,而不是head

或者只是@

git reset @~1
© www.soinside.com 2019 - 2024. All rights reserved.