git undo last commit
$ 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的更多相关文章
- [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 ...
- 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 : ...
- Git 合并多次 commit 、 删除某次 commit
Git 合并多次 commit 有时候在一个分支的多次意义相近的 commit,会把整个提交历史搞得很混乱,此时可以将一部分的 commit 合并为一个 commit,以美化整个 commit 历史, ...
- [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 ...
- 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 ...
- [Git] git revert ( revert commit 和 revert merge)
转载自:http://blog.csdn.net/qinjienj/article/details/7621887 我们难免会因为种种原因执行一些错误的commit / push,git提供了reve ...
- git取消本地commit
如果不小心commit了一个不需要commit的文件,可以对其进行撤销. 先使用git log 查看 commit日志 commit 422bc088a7d6c5429f1d0760d008d86c5 ...
- (转)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 ...
- git 多个commit 如何合并
git 多个commit 如何合并 本篇主要介绍一下 git 中多个commit 如何合并, 因为commit 太多 会导致提交记录混乱, 所以有时候会把多个commit 合并成一个 保持提交记录干净 ...
随机推荐
- verynginx +nginx_upstream_check_module模块,负载均衡检查模块。
yum -y install git yum -y install patch yum -y install pcre-devel yum install -y zlib-devel mkdir ...
- ES6笔记之参数默认值(译)
原文链接:http://dmitrysoshnikov.com/ 原文作者:Dmitry Soshnikov 译者做了少量补充.这样的的文字是译者加的,可以选择忽略. 作者微博:@Bosn 在这个简短 ...
- iOS:Xcode中SVN不能提交CocoaPods中的.a文件的解决方法
不能提交.a文件, 这个与SVN的配置有关, 其实与xcode倒没有关系. 解决方法: 1. 打开终端, 在命令行中输入: vi ~/.subversion/config 来打开配置文件.2. 然 ...
- ubuntu16.04新服务器上配置selenium+firefox
ubuntu16.041安装pythonsudo apt-get install python默认2.7.122更新apt-getsudo apt-get update更新下apt-get库否则下载p ...
- jsp 页面图片为圆形
直接设置img标签的style属性即可 <img alt="" src="链接地址" style="width: 80px;height: 80 ...
- C# 多线程控制 通讯
一.多线程的概念 Windows是一个多任务的系统,如果你使用的是windows 2000及其以上版本,你可以通过任务管理器查看当前系统运行的程序和进程.什么是进程呢?当一个程序开始运行时,它就是一 ...
- attempt to dereference a generic a pointer(转)
在Linux下的GDB环境中,用p 命令查看一个void *型的变量的时候,提示为: "attempt to dereference a generic a ...
- centos下hadoop的安装
hadoop的安装不难,可是须要做不少的准备工作. 一.JDK 须要先安装jdk.centos下能够直接通过yum install java-1.6.0-openjdk来安装.不同公布版的安装 ...
- 区分Activity的四种加载模式
在多Activity开发中,有可能是自己应用之间的Activity跳转,或者夹带其他应用的可复用Activity.可能会希望跳转到原来某个Activity实例,而不是产生大量重复的Activity. ...
- Jmeter-接口测试(二)
接口测试我们前面已经讲过,此博不做重复,我们主要讲讲如何利用Jmeter做接口测试及参数化. 一.新建项目 1.运行Jmeter.bat打开Jmeter 2.添加线程组(测试计划->添加-> ...