我正在处理一个分支,称为“experimental”,它是从我的主分支中分支出来的。然后,在“experimental”分支中生成了一个用户模型,但尚未将其添加到索引中。
如果我想放弃最近在“experimental”分支中添加的所有文件更改,我该怎么做?未跟踪的文件如下所示:
$ git status
On branch new_chick
Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
app/models/user.rb
db/migrate/
test/fixtures/users.yml
test/unit/user_test.rb
我尝试运行"git reset --hard",希望撤销所有更改,但上述所有文件仍然显示。
-x
参数,但是.project
和其他配置文件被删除了。不得不再次从上次提交的版本中将代码仓库拉取到一个新目录中。 - timekeeper