相关疑难解决方法(0)

撤消git中未暂存的部分更改

如何在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

153
推荐指数
3
解决办法
4万
查看次数

标签 统计

git ×1