您的方法git reset --soft
是正确的,但是您还必须指向正确的提交,并且在重置之后,您还没有完全完成。
# reset to the commit BEFORE (^) the first bad one
git reset --soft 274c94^
此时,您刚才在工作树中所做的三个“不良”提交中描述的修改已在您的工作树中,等待添加并提交
# then switch branch to whichever branch suits your needs
git checkout myBranch
# Add and commit the way you usually do, for example :
git add .
git commit -m "Awesome message"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句