GIT 在我的案例中添加还原(保留更改)

标签 git github

在我对文件进行更改之后。我使用 git add FILE_NAME

然后,我想将其还原为未添加,但同时保留更改,该怎么做?

最佳答案

git reset -- FILE_NAME会做的。

See the git reset manual :

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

关于GIT 在我的案例中添加还原(保留更改),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8388519/

相关文章:

iphone - XCode 4 与 Git/Github 无法提交图像

git - Netbeans 和 Git,忽略 .obj 文件

git - 使用 Github Actions 推送到个人 VPS

r - 安装 ggbiplot 时出错 - 未找到对象 'digest_impl'

Android Studio 与 GitHub 的集成无法上传除 MainActivity.java 之外的项目文件

windows - 在 git 中更改分支错误地导致修改文件

git - Jenkins 管道环境变量

javascript - 如何使用凭据在 Windows 上使用 nodegit.push

git - commit前如何查看git merge做了什么?

git - 如何使用 TortoiseGit 进行推送