如何撤消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仅用于还原更改之类的东西,那就太好了。有更好的方法吗?