# 让单个文件回退到指定的版本

  1. 进入到文件所在文件目录,或者能找到文件的路径
  2. 查看文件的修改记录
git log xxx.php
    
commit 6d9bfd8c3f79c09b622615e4fa8ede14edb8dee0
Author: baopeng <baopeng@hisense.com>
Date:   Thu May 12 20:09:53 2016 +0800
commit 42d79aff06494b5eb10c1c5d6ef210273a8ae5f1
Author: baopeng <baopeng@hisense.com>
Date:   Wed May 11 16:19:59 2016 +0800
  1. 回退到指定的版本
git reset 42d79aff06494b5eb10c1c5d6ef210273a8ae5f1 xxx.php
Unstaged changes after reset:
M xxx.php
  1. 提交到本地修改
  2. 提交到远程仓库
此文章已被阅读次数:正在加载...更新于

请我喝杯咖啡吧☕️

木亦 微信支付

微信支付

木亦 支付宝

支付宝