比如你当前所在的空间是trunk,但是执行了git pull origin branches,这时需要回滚回去,可以用一下步骤:

1、运行git reflog命令查看你的历史变更记录,如下:

69fd1684 HEAD@{13}: commit: bug修复
6cc9dd2a HEAD@{14}: pull origin v2.8.0: Fast-forward
9f7483ab HEAD@{15}: pull origin v2.8.0: Merge made by the 'recursive' strategy.
1ad219e4 HEAD@{16}: commit: bug修复
3a894700 HEAD@{17}: commit: bug修复
b50c0828 HEAD@{18}: pull origin v2.8.0: Merge made by the 'recursive' strategy.
9a4267c5 HEAD@{19}: commit: bug修复
9aa718bd HEAD@{20}: commit: bug修复
ea89ffde HEAD@{21}: pull origin v2.8.0: Fast-forward
13c328ea HEAD@{22}: checkout: moving from master to v2.8.0

2、然后用git reset --hard HEAD@{n},(n是你要回退到的引用位置)回退。

比如上图可运行 git reset --hard 9f7483ab

git 执行pull错误如何撤销的更多相关文章

  1. git subtree pull 错误 Working tree has modifications

    git subtree 是不错的东西,用于 git 管理子项目. 本文记录我遇到问题和翻译网上的答案. 当我开始 pull 的时候,使用下面的代码 git subtree pull --prefix= ...

  2. git执行pull命令时,报错

    在图形界面中,执行拉取操作时,出现下面的错误. You asked to pull from the remote 'origin', but did not specifya branch. Bec ...

  3. Git Pull 错误

    当是用TortoiseGit 从多个源 Pull过数据后, 不能再使用默认的 Remote origin选项进行Pull操作. 每个工程 Commit\Push前需要Pull操作时, 采用独立的URL ...

  4. ubuntu使用git提交github时,执行pull或者push命令要重新输入用户名和密码

    ubuntu使用git提交github时,执行pull或者push命令要重新输入用户名和密码: 1:问题现象: hlp@hlp:~/code/github_code/catch_imooc1$ git ...

  5. git的回滚与撤销【reset and revert】

    git的工作流程-- 3个区域 工作区:我们可以看到的文件内容 在操作 git add 之前的!! 缓存区:是不可见的  已经git add操作,还没git commit -m "" ...

  6. Git:pull --rebase 和 merge --no-ff

    首先是吐嘈 如果你正在 code review,看到上图(下文将称之为:提交线图)之后,特别是像我这样有某种洁癖的人,是否感觉特别难受?如果是的话,请看下文吧 :) 为什么 Git 作为分布式版本控制 ...

  7. git push/pull时总需要输入用户名密码的解决方案

    在提交项目代码或者拉代码的时候,git会让你输入用户名密码,解决方案:(我们公司用的是gitlab) 执行git config --global credential.helper store命令 然 ...

  8. 【JAVA】Eclipse中使用git进行pull远程代码

    当使用eclipse或者MyEclipse进行pull远程代码的时候,或者github的代码的时候报如下错误代码: 代表我们没有配置我们的Git地址,这里我教大家配置一下.首先下面是错误代码: The ...

  9. Git - 暂存区及撤销修改

    1. 暂存区 每个 Git 仓库中,都有一个隐藏目录 .git 用于存放 Git 仓库的相关信息,包括暂存区(称为 stage).自动创建的 master 分支以及指向 master 分支的 HEAD ...

随机推荐

  1. GAITC 2019全球人工智能技术大会(南京)

    2019年5月25日至26日,由中国人工智能学会主办,以“交叉.融合.相生.共赢”为主题的2019GAITC将在南京全新亮相. 2019 全球人工智能技术大会(2019 GAITC)以“前端引领.深度 ...

  2. Scala控制语句

    2019-04-16 19:03:01 if else 表达式 var sumVal = 0 if ( sumVal == 0 ) { println("true") } else ...

  3. Summary: Calculate average where sum exceed double limits

    What is a good solution for calculating an average where the sum of all values exceeds a double's li ...

  4. sql中批量插入begin的使用

    private static String ADD_ATTR_EXT_ITEM="insert into attr_ext_item(attr_ext_main_key,attr_name_ ...

  5. php读取和导出Excel文件

    require 'vendor/PHPExcel/PHPExcel.php';require 'vendor/PHPExcel/PHPExcel/IOFactory.php'; public func ...

  6. Color Schema 配色随笔

    附pdf文件: ColorSchema.pdf

  7. ORA-01589解决

    错误展现如下: sqlplus /nolog SQL> conne /as sysdbaConnected.SQL> shutdown abortORACLE instance shut ...

  8. Java面试题整理---Redis篇

    1.redis支持五种数据结构类型?   2.redis内部结构?   3.redis持久化机制?   4.redis集群方案与实现?   5.redis为什么是单线程的?   6.redis常见回收 ...

  9. ORA-08176 错误的一个案例

    在演示事务的read only mode 的时候,因为一个错误有了这个意外的收获.场景是这样的: 在session 1 中执行了如下的语句. SQL> set transaction read ...

  10. 2.裴波那契(Fibonacci)数列

    裴波那契(Fibonacci)数列 f(n)= ⎧⎩⎨0,1,f(n−1)+f(n−2),n =0n =1n>1 求裴波那契数列的第n项.(题目来自剑指offer) 1.递归解法,效率很低的解法 ...