如何在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
Run Code Online (Sandbox Code Playgroud)
这样可行,但如果git commit --interactive只有恢复变更的话会很好.有更好的方法吗?
git ×1