撤消多个文件和文件夹"git add" [英] Undo multiple file and folder 'git add'

查看:57
本文介绍了撤消多个文件和文件夹"git add"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行了

git add .

,现在我要还原该git add.我该怎么做?

and now I want to revert that git add. How can I accomplish that?

推荐答案

git reset (等同于 git reset HEAD )将取消添加 add (更常见的是"unstage")所有文件.

git reset (which is equivalent to git reset HEAD) will un-add (more commonly "unstage") all files.

在Git中, revert 用于撤消现有的提交(通常是一段时间前发生的或已与其他人共享的提交).如果尚未与其他人共享提交,则可以使用重写"最近历史记录的方法,这样您就可以假装要还原的更改本来就不会发生.

In Git, revert is used for undoing an existing commit (typically a commit that happened a while ago, or has been shared with others). If your commit has not yet been shared with others, there are ways to "rewrite" recent history such that you can pretend the changes you want to revert never happened in the first place.

这篇关于撤消多个文件和文件夹"git add"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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