【发布时间】:2020-07-09 17:06:44
【问题描述】:
我想在我的功能分支中重置 1 个文件,我按照这里的建议做了:
Git reset single file in feature branch to be the same as in master
但是当我执行 git status 时,我仍然看到文件在我的功能分支中被修改 当我提出拉取请求时,我仍然在这个文件中看到合并。 尝试做:
git reset HEAD include/tools.h
然后
git push
但仍处于修改状态
$ git 状态
On branch feature/myfix
Your branch is up to date with 'origin/feature/myfix'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: include/tools.h
我应该如何重置这个文件,我想要主版本
【问题讨论】:
-
如果您想放弃自己的工作,请尝试按照 Git 打印的说明操作:
git checkout -- include/tools.h。
标签: git