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:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-git>git checkout branches
Already on 'branches'
Your branch is up-to-date with 'origin/branches'. D:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-git>git branch branches_bak
D:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-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:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-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:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-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:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-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:\soft\devleop_tools\ideaUI\IntelliJ IDEA 14.1.3\workspace\fclient-git>
Thank is all ~~
Git回版本回退的更多相关文章
- Git(时光机-版本回退)
现在,你已经学会了修改文件,然后把修改提交到Git版本库,现在,再练习一次,修改readme.txt文件如下: Git is a distributed version control system. ...
- Git学习--版本回退
现在,你已经学会了修改文件,然后把修改提交到Git版本库,现在,再练习一次,修改readme.txt文件如下: Git is a distributed version control system. ...
- idea中git远程版本回退
idea中git远程版本回退 2017年10月15日 15:25:36 gomeplus 阅读数:19313 工作中遇到git远程仓库需要回退到历史版本的问题,根据网上的搜索结果结合自己的实践,整理了 ...
- git指令-版本回退
git指令-版本回退 回顾: 1. 修改文件 2. 添加到暂存区并提交 回顾对readme共三次修改: 1. 版本1:wrote a readme file Git is a version cont ...
- git远程版本回退
本文为博主原创,未经允许不得转载: 之前在git提交版本时,发现将新开发的代码提交到了另一个分支上,为了不影响提交分支代码的 功能,需要回退到之前的版本. 在使用命令回退的时候,一直没有回退成功,有个 ...
- Git之版本回退及回滚
应用场景 当开发某个项目时,会有多次提交记录,如A版本àB版本àC版本,假如目前处于C版本状态,我想回退到A版本,该如何操作:而当回退到A版本后,我又想回滚到B版本,又该如何操作,见下文分解!
- git的版本回退探索
简介 今天改完代码匆忙提交,上线发现有问题,那怎么办?废话,赶紧回滚,那怎么回滚,开始用git reset [--soft | --mixed | --hard 命令,但这命令真的能达到我预期的效果吗 ...
- [git 学习篇] git文件版本回退再学习
需求; 准备把readme.txt回退到上一个版本,也就是“add distributed”的那个版本 首先,Git必须知道当前版本是哪个版本,在Git中,用HEAD表示当前版本,也就是最新的提交3 ...
- git 远端版本回退
情景:本地更改推送远端后,想要回退到自己推送之前的某个版本. 比如想回退的分支为 test 分支. 风险:远端回退到某一版本后,之后的所有推送都没了(对应的日志记录也没了).如果是团队开发,不仅自己推 ...
随机推荐
- 12.18 分布式系统下的session
广义的session: 会话控制,可以理解成为一种保存key-value的机制 从key的方面来看:sessionId和token sessionId: 服务端请求客户端的时候,服务端通过setcoo ...
- C# Http方式下载文件到本地类
直接上代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using S ...
- Java 方法重载与方法重写
方法重载(Overload): 1.在同一个类中 2.方法名相同 3.参数的个数或类型不同 4.与方法的返回类型无关 5.与方法的修饰符无关 方法重写(Override): 方法重写必须是子类继承父类 ...
- Linux:修改Shell命令提示符及颜色
Linux修改Shell命令提示符及颜色 1. Linux登录过程中加载配置文件顺序: /etc/profile → /etc/profile.d/*.sh → ~/.bash_profile → ...
- ImportError: liblapack.so.3: cannot open shared object file问题
问题: 安装完tensorflow后,在终端输入: python import cv2 出现如下错误: ImportError: liblapack.so.3: cannot open shared ...
- "PEP:8 expected 2 blank lines ,found 1"
pycharm shows "PEP:8 expected 2 blank lines ,found 1" 用pycharm写python的时候,总会在def function() ...
- ThreadDeath 理解
public class RunnableTest2 { public static Object obj1 = new Object(); public static Object obj2 = n ...
- Android:Activity & Intent
参考:<第一行代码:Android> 郭霖(著) 2.2 Activity的基本用法 隐藏标题栏 在AndroidManifest.xml中配置,作为全局配置,在所有Activity范 ...
- java-文件流正确关闭资源
用文件流来拷贝一个文件,用到文件字节输入流(FileInputStream)和文件字节输出流(FileOutputStream),用输入流把字节文件读到缓冲数组中,然后将缓冲数组中的字节写到文件中,就 ...
- 几张 ejabberd 架构部署图