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

首先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 恢复部分文件或者文件夹到某版本)