美文网首页
git 恢复部分文件或者文件夹到某版本

git 恢复部分文件或者文件夹到某版本

作者: 笃笃木鱼 | 来源:发表于2019-08-06 22:03 被阅读0次

    首先git log查看历史版本


    git log

    然后还原版本
    还原单个文件

      git checkout 07ed0f4a1b9118124df26d62ffa8c253ec540207 E:/Workspaces/WebStormProject/mobile/resources/ios/splash/Default@2x~iphone.png
    

    还原多个文件(使用通配符)

      git checkout 07ed0f4a1b9118124df26d62ffa8c253ec540207 E:/Workspaces/WebStormProject/mobile/resources/ios/splash/Default*.png
    

    还原文件夹

    git checkout 07ed0f4a1b9118124df26d62ffa8c253ec540207 E:/Workspaces/WebStormProject/mobile/resources/ios/splash/
    

    使用相对路径(相对路径最开始不能有斜杠)

      git checkout 07ed0f4a1b9118124df26d62ffa8c253ec540207 resources/ios/splash/
    

    相关文章

      网友评论

          本文标题:git 恢复部分文件或者文件夹到某版本

          本文链接:https://www.haomeiwen.com/subject/opegdctx.html