如何在 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
的东西只用于还原更改就更好了。有更好的办法吗?