zoukankan      html  css  js  c++  java
  • Git回版本回退

    这里我们使用命令行的方式对已经提交的版本进行强行回退操作~~~

    一、将git的安装目录bin放到path路径中,

           如下图所示:

           

    二、进入cmd界面,依次输入下面内容即可(git 远程仓库 回退到指定版本)

    git checkout branches          #检出当前分支 
    git branch branches_bak     #备份相关分支
    git reset --hard 版本号          #将本地代码强行回退到指定的版本号
    git push -f origin branches       #将本地分支强行push到远程分支上面

    下面是我的相关执行操作,仅供参考:

    Microsoft Windows [版本 6.1.7601]                                                                                                                                                                                                                                   
    版权所有 (c) 2009 Microsoft Corporation。保留所有权利。                                                                                                                                                                                                             
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>git checkout branches
    Already on 'branches'
    Your branch is up-to-date with 'origin/branches'.
     
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>git branch branches_bak                                                                                                                                                                                      
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>git reset --hard cfdbafc7
    HEAD is now at cfdbafc 修改登录相关的配置                                                                                                                                                                 
     
    Warning: Your console font probably doesn't support Unicode. If you experience strange characters in the output, consider switching to a TrueType font such as Consolas!
     
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>git reset --hard cfdbafc7
    HEAD is now at cfdbafc 修改登录相关的配置                                                                                                                                                                 
     
    Warning: Your console font probably doesn't support Unicode. If you experience strange characters in the output, consider switching to a TrueType font such as Consolas!
     
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>git push -f origin braches
    error: src refspec braches does not match any.
    error: failed to push some refs to 'http://***.com/app/**.git'
     
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>git push -f origin branches
    Username for 'http://***.com': zhanghao80
    Password for 'http://zhanghao80@***.com':
    Total 0 (delta 0), reused 0 (delta 0)
    remote: Updating references: 100% (1/1)
    To http://***.com/app/**.git
     + bfdb901...cfdbafc branches -> branches (forced update)
     
    D:softdevleop_toolsideaUIIntelliJ IDEA 14.1.3workspacefclient-git>
    

      

      

    Thank is all ~~

  • 相关阅读:
    前端上传组件Plupload使用指南
    移动前端开发之viewport的深入理解
    性能更好的js动画实现方式——requestAnimationFrame
    如何判断一个js对象是否一个DOM对象
    用Phaser来制作一个html5游戏——flappy bird (二)
    用Phaser来制作一个html5游戏——flappy bird (一)
    css选择器中:first-child与:first-of-type的区别
    用node-webkit把web应用打包成桌面应用
    为Titanium创建自己的安卓推送模块
    Titanium中调用ios组件时语言不是本地化的解决方法
  • 原文地址:https://www.cnblogs.com/xiohao/p/5521230.html
Copyright © 2011-2022 走看看