0
 On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       deleted:    web/img/add-btn-bg.png
#       deleted:    web/img/add-tribute-button.png
#       deleted:    web/img/bottom-shadow.png
#       deleted:    web/img/database-line.png
#       deleted:    web/img/glyphicons-halflings-white.png
#       deleted:    web/img/glyphicons-halflings.png
#       deleted:    web/img/header-logo.png
#       deleted:    web/img/horizontal-line.png
#       deleted:    web/img/icons-btn.png
#       deleted:    web/img/icons.png
#       deleted:    web/img/line-bottom-menu.png
#       deleted:    web/img/never-forget.png
#       deleted:    web/img/tribute-icon-line.png
#       deleted:    web/img/uszatek.jpg
#       deleted:    web/img/uszatek_106.jpg
#       deleted:    web/img/uszatek_148.jpg
#       deleted:    web/img/uszatek_32.jpg
#       deleted:    web/img/uszatek_50.jpg
#
# 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:   web/app_dev.php
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       img/
#       randomNames.csv
#       sampledb.tgz
#       watch/
#       web/assets/
#       web/uploads/

我需要从“要提交的更改”返回文件。怎么做?

4

1 回答 1

1

如果您还没有提交,这里是如何取回一个文件(使用web/img/glyphicons-halflings-white.png作为一个例子):

git reset HEAD web/img/glyphicons-halflings-white.png
git checkout -f web/img/glyphicons-halflings-white.png

这将取消暂存删除操作,然后恢复文件。

于 2012-10-19T15:09:46.070 回答