首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在git中撤消部分未暂存的更改

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

Stack Overflow用户
提问于 2009-12-31 03:00:27
回答 6查看 48.6K关注 0票数 169

如何在git中撤消部分未暂存的更改,而将其余更改保留为未暂存?我想出来的方法是:

代码语言:javascript
复制
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这样的东西只用于恢复更改就更好了。有更好的方法吗?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1981830

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档