如何在git中签出旧版本的文件夹 [英] How to checkout old version of folder in git

查看:107
本文介绍了如何在git中签出旧版本的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从原点处进行更改。问题在于其中一个库已经更新到最新版本,并且使我的应用程序崩溃。我想提取最近的更改,然后返回到以前(或特定)版本的只有一个文件夹,其中包含导致lib的问题。有没有办法做到这一点?

I need to pull changes from origin. Problem is that one of libs was updated to newest version and it crashes my part of application. I would like to pull recent changes and then go back to previous (or specific) version for only one folder, which contains that problem causing lib. Is there any way to do that?

推荐答案

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

这将检出 LAST_WORKING_COMMIT版本中的文件夹。但是, git status 会告诉您文件已被修改:

This will check out the folder in the version of LAST_WORKING_COMMIT. However, git status will then tell, that the files are modified:

$ 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")

这篇关于如何在git中签出旧版本的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆