git reflog 和git log的区别,外加git cherry-pick的一种用法

git reflog 可以查看所有分支的所有操作记录(包括(包括commit和reset的操作),包括已经被删除的commit记录,git log则不能察看已经删除了的commit记录

具体一个例子,假设有三个commit, git st:

commit3: add test3.c

commit2: add test2.c

commit1: add test1.c

如果执行git reset --hard HEAD~1则 删除了commit3,如果发现删除错误了,需要恢复commit3,这个时候就要使用git reflog

 HEAD@{0}: HEAD~1: updating HEAD
63ee781 HEAD@{1}: commit: test3:q
红色加粗的即是被删除了的 commit3,运行git log则没有这一行记录

可以使用git reset --hard 63ee781将红色记录删除,则恢复了cmmit3,运行git log后可以看到:

commit3: add test3.c

commit2: add test2.c

commit1: add test1.c

这里也可以使用另外一种方法来实现:git cherry-pick 63ee781

git reflog 和git log :no branch git 提交方式的更多相关文章

  1. Git 协作:Fetch Pull Push Branch Remote Rebase Cherry-pick相关

    前言 学习git的时候,我们首先学习的是最常用的,自己独立开发Software时用的命令: git init //初始化git仓库 git add <file_name> //将文件添加到 ...

  2. Git reflog 引用日志使用详解

    本章节主要介绍 git reflog 命令. Git 使用一种称为引用日志或"reflogs"的机制来跟踪分支顶端的更新. 许多 Git 命令接受用于指定引用或"ref& ...

  3. Git学习总结(5)——搭建Git简易高效服务器

    1. mysysgit+gitblit安装流程 1.1资源  需先下载好的资源(公司用的1.6,1.7+请自行匹配对应的mysysgit+gitblit):  jdk1.6  Git-1.8.4-pr ...

  4. Git相关二三事(git reflog 和彩色branch)【转】

    转自:https://www.jianshu.com/p/3622ed542c3b 背景 git太常用了,虽然,用起来不难,但也有很多小技巧的东西... 1. 后悔药 哪天不小心,写完代码,没comm ...

  5. Git log和git reflog

    1.git log  log命令可以显示所有提交过的版本信息.显示信息如下: $ git log commit e1bdff6e4830e09383078c860f45334d03771b03 (HE ...

  6. git log 与 git reflog 的 区别

    git log: commit 的版本日志 包含提交的版本 操作者 日期 (方便查看commit的版本,但是版本回退后,使用git log 看不到回退版本号之后的版本记录) commit ce0d69 ...

  7. 比 git log 更强大的 git reflog

    最近做了个骚操作 git checkout commitId 修改了部分内容 git add . git commit -m '修改了些东西'   -> 此时git 会自动生成一个新的 comm ...

  8. [译]git reflog

    用法 git reflog 显示整个本地仓储的commit, 包括所有branch的commit, 甚至包括已经撤销的commit, 只要HEAD发生了变化, 就会在reflog里面看得到. git ...

  9. git merge,rebase和*(no branch)

    上一篇:http://blog.csdn.net/xiaoputao0903/article/details/23933589,说了git的分支,相关的使用方法没说到可是仅仅要google就能搜出一大 ...

随机推荐

  1. (转)fastdfs group通过添加硬盘扩容

    通过给group的机器添加硬盘的方式,实现某个group的扩容. fastdfs在一台服务器支持多个store_path,每个store_path指向一个存储路径.url “M00/3F/E1/oYY ...

  2. Redis Cluster踩过的坑

    Redis Cluster踩过的坑请参考如下链接:http://www.iteye.com/blogs/subjects/Redis_Cluster_Devops

  3. MongoDB基本操作

    转:http://zhidao.baidu.com/link?url=D5s4tNnP6hH0XPZkFooV-o4MQH3pNZh7C3rtLX_HtVWaIyBRhLIUyoZYfVv15l2eS ...

  4. JDBC入门连接MySQL查数据

    在MySQL中建立user表,插入数据 create table user( id int, name varchar(10), age int )engine myisam charset utf8 ...

  5. phpize php扩展模块安装

    安装(fastcgi模式)的时候,常常有这样一句命令:/usr/local/webserver/php/bin/phpize一.phpize是干嘛的?phpize是什么东西呢?php官方的说明:htt ...

  6. Android系统简介(上):历史渊源

    上个月,看到微信的一系列文章,讲到Linux的鼻祖-李纳斯的传记<Just for Fun>, 其人神乎其能, 其人生过程非常有趣,值得每个程序员细细品味. 而实际上,对我而已,虽然做软件 ...

  7. 信鸽推送.net 服务端代码

    //推送代码 private void send() { #region 安卓推送 XingeApp app = new XingeApp("accessId", "se ...

  8. 转:ASP.NET MVC 3 and App_Code folder

    问题: In ASP.NET Webform, App_Code is standardfolder to putting code and using it at run-time.But I th ...

  9. CSS3滤镜!!!

    <!DOCTYPE html> <html> <head> <style> img { width: 33%; height: auto; float: ...

  10. android 登陆案例

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABEMAAAJuCAIAAADU3FtnAAAgAElEQVR4nOydZ3Rc1dX3nbXez2+erC