git 修改上次提交信息 与 撤销此操作.
2015-07-29 13:30
417 查看
git commit --amend
修改刚才提交的commit信息撤销 git commit --amend
思路是使用 git reflog 查看在哪里ammend的.找到HEAD{N},N是ammend之前的那个数.
然后使用
git reset --soft HEAD@{N}
see at http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit # Move the current head so that it's pointing at the old commit # Leave the index intact for redoing the commit git reset --soft HEAD@{1} # commit the current tree using the commit details of the previous # HEAD commit. (Note that HEAD@{1} is pointing somewhere different from the # previous command. It's now pointing at the erroneously amended commit.) git commit -C HEAD@{1}
相关文章推荐
- Android强制切换横屏竖屏不起作用的解决办法
- ORACLE統計信息收集
- linux下解压缩*.tar.xz方法
- SVN服务器搭建和使用(二)
- 煎饼侠大鹏如何屌丝逆袭:用互联网卖笑
- 黑马程序员--Java--正则和反射
- vi快捷键使用
- SVN服务器搭建和使用(一)
- jquery学习教程视频 链接
- C语言中关键字static的作用
- DELPHI RES资源文件使用方法
- DFS+剪枝 HDOJ 5323 Solve this interesting problem
- iOS KVO概述及用法
- 快速排序
- 欢迎使用CSDN-markdown编辑器
- iOS 移动开发月报-第1期
- Mysql 第十日 字符集,XA事务,查询缓存
- 求数组的全排列
- 暑假集训第三周 STL T-看病要排队
- IOS中根据生日精确计算年龄