取消错误提交的问题

时间:2019-05-06 22:18:52

标签: git github

我试图提交在存储库中所做的一些修改;但收到以下答案:

我尝试使用git reset HEAD最终项目/ Gcode / Prueba BioMaterial_Funciono! .txt

它没有用。

这是实际的git状态

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   Final Project/Gcode/Prueba BioMaterial_Funciono! .txt

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    Final Project/Gcode/Prueba BioMaterial_Funciono! .txt

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        Final Project/Gcode/Prueba_BioMaterial_Funciono! .txt

我需要能够将自己的预付款推送到存储库中。

1 个答案:

答案 0 :(得分:2)

git reset HEAD "Final Project/Gcode/Prueba BioMaterial_Funciono! .txt"应该足够了。

!和文件扩展名之间有一个空格字符,这使得命令提示符解析两个参数:[filename].txt

将所有内容都放在引号中应该可以解决问题。