$ git commit -m "Something terribly misguided"              (1)
$ git reset --soft HEAD~ (2)
<< edit files as necessary >> (3)
$ git add ... (4)
$ git commit -c ORIG_HEAD (5)
转自: http://stackoverflow.com/questions/927358/how-do-you-undo-the-last-commit

git undo last commit的更多相关文章

  1. [Git] Undo a commit that has already been pushed to the remote repository

    If we pushed our changes already to the remote repository we have to pay attention to not change the ...

  2. Git error on commit after merge - fatal: cannot do a partial commit during a merge

    Git error on commit after merge - fatal: cannot do a partial commit during a merge this answer is : ...

  3. Git 合并多次 commit 、 删除某次 commit

    Git 合并多次 commit 有时候在一个分支的多次意义相近的 commit,会把整个提交历史搞得很混乱,此时可以将一部分的 commit 合并为一个 commit,以美化整个 commit 历史, ...

  4. [Git/GitHub] Tutorial 1. Git download and commit first project

    1. Install at https://git-scm.com/downloads 2. Set up your name and email $ git config --global user ...

  5. Git冲突:commit your changes or stash them before you can merge.

    用git pull来更新代码的时候,遇到了下面的问题: error: Your local changes to the following files would be overwritten by ...

  6. [Git] git revert ( revert commit 和 revert merge)

    转载自:http://blog.csdn.net/qinjienj/article/details/7621887 我们难免会因为种种原因执行一些错误的commit / push,git提供了reve ...

  7. git取消本地commit

    如果不小心commit了一个不需要commit的文件,可以对其进行撤销. 先使用git log 查看 commit日志 commit 422bc088a7d6c5429f1d0760d008d86c5 ...

  8. (转)Git冲突:commit your changes or stash them before you can merge. 解决办法

    用git pull来更新代码的时候,遇到了下面的问题: error: Your local changes to the following files would be overwritten by ...

  9. git 多个commit 如何合并

    git 多个commit 如何合并 本篇主要介绍一下 git 中多个commit 如何合并, 因为commit 太多 会导致提交记录混乱, 所以有时候会把多个commit 合并成一个 保持提交记录干净 ...

随机推荐

  1. http://www.oschina.net/code/snippet_12_13918

    http://www.oschina.net/code/snippet_12_13918

  2. netty参考

    前言 问题 现如今我们使用通用的应用程序或者类库来实现系统之间地互相访问,比如我们经常使用一个HTTP客户端来从web服务器上获取信息,或者通过web service来执行一个远程的调用. 然而,有时 ...

  3. C# 多线程控制 通讯

    一.多线程的概念  Windows是一个多任务的系统,如果你使用的是windows 2000及其以上版本,你可以通过任务管理器查看当前系统运行的程序和进程.什么是进程呢?当一个程序开始运行时,它就是一 ...

  4. [Functional Programming] Combine Multiple State ADT Instances with the Same Input (converge(liftA2(constant)))

    When combining multiple State ADT instances that depend on the same input, using chain can become qu ...

  5. wine 魔兽争霸

    连接参见http://linux-wiki.cn/wiki/%E7%94%A8Wine%E8%BF%90%E8%A1%8C%E9%AD%94%E5%85%BD%E4%BA%89%E9%9C%B8III ...

  6. Servlet——简单用户登录实例+http协议解析

    编写项目.用户登录系统1.0版本号 登录界面Servlet: package com.gavin.view; import java.io.IOException; import java.io.Pr ...

  7. 对帝国cms、dedecms、phpcms等负载测试总结

    来自:http://www.chinaz.com/web/2013/0729/311360.shtml 担心被骂,本不想写这篇文章.犹豫良久,最终还是决定写.希望能够帮助到一些朋友,认识到数据库索引正 ...

  8. leetcode268:Missing Number

    描写叙述 Given an array containing n distinct numbers taken from 0, 1, 2, -, n, find the one that is mis ...

  9. Ubuntu系统进程绑定CPU核

    Ubuntu系统进程绑定CPU核 作者:chszs.版权全部,未经允许,不得转载. 博主主页:http://blog.csdn.net/chszs 本文讲述如何在Ubuntu系统中,把指定的进程绑定到 ...

  10. 【UVA】11468-Substring(AC自己主动机)

    AC自己主动机的题,须要注意的,建立失配边的时候,假设结点1失配边连到的那个结点2,那个结点2是一个单词的结尾,那么这个结点1也须要标记成1(由于能够看成,这个结点包括了这个单词),之后在Trie树上 ...