鉴于git分支上有一些提交(C是最近的提交):
A -> B -> C
Run Code Online (Sandbox Code Playgroud)
如何重置我的工作区,以便所有文件都处于它们在提交B的状态,但HEAD仍在C?
我看过了git-reset
,但没有一个选项似乎有帮助.手册页建议所有不同的模式将移动HEAD:
Run Code Online (Sandbox Code Playgroud)--soft Does not touch the index file or the working tree at all (but resets the head to <commit>, just like all modes do).
我试过了,git reset HEAD~
但这会让HEAD感动.