如何丢弃 Git 中未暂存的更改? [英] How do I discard unstaged changes in Git?

查看:37
本文介绍了如何丢弃 Git 中未暂存的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何丢弃工作副本中未在索引中的更改?

How do I discard changes in my working copy that are not in the index?

推荐答案

另一种更快的方法是:

git stash save --keep-index --include-untracked

如果您不想彻底了解它,则不需要包含 --include-untracked.

You don't need to include --include-untracked if you don't want to be thorough about it.

之后,如果您愿意,您可以使用 git stash drop 命令删除该存储.

After that, you can drop that stash with a git stash drop command if you like.

这篇关于如何丢弃 Git 中未暂存的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆