GIT在我的情况下添加回复(保持更改) [英] GIT add revert in my case (keep changes)

查看:125
本文介绍了GIT在我的情况下添加回复(保持更改)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在对文件进行更改后。我使用 git add FILE_NAME 然后,我想将它恢复为未添加,但与此同时保留更改,如何执行此操作?

解决方案

git reset - FILE_NAME p>

请参阅 git reset manual

lockquote

这个表格重置所有<路径> 到它们在< commit> 的状态。 (它不影响工作树,也不影响当前分支。)



这意味着 git reset<路径> git add<路径>



相反

After I made changes on a file. I use git add FILE_NAME.

Then, I would like to revert it as not added but meanwhile keep the changes, how to do this?

解决方案

git reset -- FILE_NAME will do it.

See the git reset manual:

This form resets the index entries for all <paths> to their state at <commit>. (It does not affect the working tree, nor the current branch.)

This means that git reset <paths> is the opposite of git add <paths>.

这篇关于GIT在我的情况下添加回复(保持更改)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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