【发布时间】:2010-12-31 05:02:21
【问题描述】:
如何在 git 中撤消部分未暂存的更改,但将其余部分保持为未暂存状态?我想出的办法是:
git commit --interactive
# Choose the parts I want to delete
# Commit the changes
git stash
git rebase -i master # (I am an ancestor of master)
# Delete the line of the most recent commit
git stash apply
这可行,但如果有类似git commit --interactive 的东西仅用于恢复更改,那就太好了。还有更好的方法吗?
【问题讨论】:
标签: git