Given a git branch with some commits on it (C is the most recent commit):
A -> B -> C
How do I reset my workspace so that all the files are in the state they were at commit B, but HEAD is still at C?
I've looked at git-reset
, but none of the options seem to help. The man page suggests that all the different modes will move HEAD:
--soft
Does not touch the index file or the working tree at all
(but resets the head to <commit>, just like all modes do).
I've tried git reset HEAD~
but that moves HEAD.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…