[Git] Undo my last commit and split it into two separate ones
When you accidentally committed some changes to your branch you have various possibilities to “undo” that operation and add some more changes. One is to use git amend to change the commit message or add new files. But what we want to take out all of the committed changes again and maybe even split them into separate commits. Let’s see how we can achieve that. Note: This only holds if you did not yet push your changes to the remote repository.
In this case, what we can do is first do the reset:
git reset HEAD~
Then spreate files into diifferent commit messages.
[Git] Undo my last commit and split it into two separate ones的更多相关文章
- git cherry-pick合并某个commit
1.使用方法及其作用 git cherry-pick可以选择某一个分支中的一个或几个commit(s)来进行操作(操作的对象是commit).例如,假设我们有个稳定版本的分支,叫v2.0,另外还有个开 ...
- svn迁移到git仓库并保留commit历史记录
svn迁移到git仓库并保留commit历史记录 最近在做svn迁移到gitlab,由于之前一直是由svn做版本控制.最简单的方式是将svn的内容export出来,然后添加到gitlab即可.但是,如 ...
- git 对比两个commit 之间的差异
git 对比两个commit 之间的差异 比较两个版本之间的差异 git diff commit-id-1 commit-id-2 > d:/diff.txt 结果文件diff.txt中: &q ...
- Git合并最近的commit
合并commit的做法一般用在pull request的时候,把开发同一功能时的所有琐碎的commit合并到一个(假装自己的代码是高质量代码(手动滑稽)).主要使用的命令是git rebase 或者g ...
- (转)git合并多个commit
原文地址:http://platinhom.github.io/2016/01/02/git-combine_commit/ 有时commit多了看着会不爽.所以想合并掉一些commit. 这里是最简 ...
- 使用git rebase合并多次commit
使用git rebase合并多次commit 聊下 git rebase -i
- Git missing Change-Id in commit message footer解决方法
Git missing Change-Id in commit message footer解决方法在Git向服务器提交代码时,出现如下错误missing Change-Id in commit me ...
- 『现学现忘』Git对象 — 17、Commit对象
目录 1.Commit对象介绍 2.Commit对象说明 3.本地库中对象之间的关系 4.总结 5.练习 6.本文用到的命令总结 1.Commit对象介绍 现在来介绍最后一种Git对象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 ...
随机推荐
- MongoDB简单使用 —— 驱动
C#中可以通过官方的驱动MongoDB.Drvier来使用,使用Nuget安装即可. Install-Package MongoDB.Driver Bson文档操作: using MongoDB.Bs ...
- STM32 GPIO fast data transfer with DMA
AN2548 -- 使用 STM32F101xx 和 STM32F103xx 的 DMA 控制器 DMA控制器 DMA是AMBA的先进高性能总线(AHB)上的设备,它有2个AHB端口: 一个是从端口, ...
- javascript: Math.sin() cos() 用法
Math.sin(x) x 的正玄值.返回值在 -1.0 到 1.0 之间: Math.cos(x) x 的余弦值.返回的是 -1.0 到 1.0 之间的数: 这两个函数中的X 都是指 ...
- Java Calendar,Date,DateFormat,TimeZone,Locale等时间相关内容的认知和使用(1) Calendar
Java 操作日期/时间,往往会涉及到Calendar,Date,DateFormat这些类. 最近决定把这些内容系统的整理一下,这样以后使用的时候,会更得心应手.本章的内容是主要讲解“Java时间框 ...
- iOS用全局宏的概念理解xcode中的设置 preprocessor macros
ios有没有全局宏,或者在工程属性里设置宏? 比如我设置了一个宏叫IOS, 在所有/整个工程的代码里这个宏都是有效的. ------解决方案-------------------- 在工程的设置属性里 ...
- C#编程(二十五)----------接口
接口 如果一个类派生自一个接口,声明这个类就会实现某些函数.并不是所有的面向对象的语言都支持接口. 例如,有一个接口:IDispoable,包含一个方法Dispose(),该方法又类实现,用于清理代码 ...
- java把指定文字输出为图片流,支持文字换行
public class IamgeUtils { private static final int WIDTH = 350; private static final int HEIGHT = 10 ...
- 绝望的主妇第八季/Desperate Housewives迅雷下载
绝望的主妇 第七季 Desperate Housewives Season 8(2011) 本季看点:曾经在<主妇>中有过重要演出的达娜·德拉尼(Dana Delany), 凯尔·麦克拉克 ...
- C# 泛型的简单理解(安全、集合、方法、约束、继承)
前言 泛型允许你在编译时实现类型安全.它们允许你创建一个数据结构而不限于一特定的数据类型.然而,当使用该数据结构时,编译器保证它使用的类型与类型安全是相一致的.泛型提供了类型安全,但是没有造成任何性能 ...
- Android判断用户的网络类型(2/3/4G、wifi)
很多时候需要先判断当前用户的网络,才会继续之后的一些处理逻辑.但网络类型获取这一块,我用我自己的的手机调试时遇到一些问题,这里记录一下. 一加手机一代,移动4G 网络,得到的subtype类型值为17 ...