6

我需要从原点提取更改。问题是其中一个库已更新到最新版本,它使我的应用程序部分崩溃。我想提取最近的更改,然后返回到仅一个文件夹的先前(或特定)版本,其中包含导致 lib 的问题。有没有办法做到这一点?

4

2 回答 2

11
git checkout LAST_WORKING_COMMIT -- vendor/library/in/question

这将检查LAST_WORKING_COMMIT. 但是,git status然后会告诉文件已修改:

$ git status
# On branch master
# 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:   vendor/library/in/question/file.exe
#
no changes added to commit (use "git add" and/or "git commit -a")
于 2013-02-12T09:41:17.863 回答
7

使用附加参数git checkout

git checkout REV -- folder
于 2013-02-12T09:39:22.947 回答