[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 history (using commands like rebase, reset, amend etc). Other collaborators of the same repository might already have pulled your changes, thus resulting into horrible, strange merge conflicts if we change the git history. There are some “safer commands” for undoing in such cases.
If you push something we shouldn't push to git, we can revert it:
First, using git log to get the commit id you want to revert, then using:
git revert <commit_id>
Then push to git
[Git] Undo a commit that has already been pushed to the remote repository的更多相关文章
- 【git基础】Permission denied (publickey). fatal: Could not read from remote repository
运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.22 ...
- git undo last commit
$ git commit -m "Something terribly misguided" (1) $ git reset --soft HEAD~ (2) << e ...
- 使用Git出现以下错误"Git@github.com: Permission denied (publickey). Could not read from remote repository."解决方案
转载于:https://blog.csdn.net/dotphoenix/article/details/100130424 git@github.com: Permission denied (pu ...
- [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” ...
- 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] Change the commit message of my last commit
Did you make a typo in your last commit message? No problem, we can use the git --amend command to c ...
随机推荐
- Timer-triggered memory-to-memory DMA transfer demonstrator
http://www.efton.sk/STM32/bt.c // Timer-triggered memory-to-memory DMA transfer demonstrator for STM ...
- 关于在Struts2的Action中使用domain模型接收参数的问题
最近在搭建一个最新的ssh2框架,今天在调试的时候,发现了一个以前一直没有注意过的问题,我在Action中使用域模型的方式去接收jsp画面中的参数的时候,发现参数总是接收不完,头一次遇到这种问题,现在 ...
- 为什要使用预编译SQL?(转)
本文转自https://www.cnblogs.com/zouqin/p/5314827.html 今天在研发部技术大牛的指点下,我终于明白了为什么要使用SQL预编译的形式执行数据库JDBC:
- ASIHTTPRequest-断点续传需要原网站支持!
转:http://zyc-to.blog.163.com/blog/static/17152400201110221114526/ 从0.94版本开始,ASIHTTPRequest可以恢复中断的下载 ...
- StringBuffer与StringBuilder差别
从JDK源代码能够看出,StringBuffer和StringBuilder都是继承自AbstractStringBuilder,事实上这两个类的功能实现都是在AbstractStringBuilde ...
- Unity3d-Particle System系统的学习(二)
这节我们继续上节没讲完的Particle参数. 上节我们讲了Emission发射器参数,我们接着往下讲Shape: 可以看到这个子模块的参数是跟形状有关: 1.Shape:发射形状.粒子被约束在这个形 ...
- SharePoint Online 创建文档库
前言 本文介绍如何在Office 365中创建文档库,以及文档库的一些基本设置. 正文 通过登录地址登录到Office 365的SharePoint Online站点中,我们可以在右上角的设置菜单中, ...
- 趣谈Java变量的可见性问题
了解过多线程的我们,对synchorized,sleep和valatile都比较了解,但是当这三个名词和“Java变量得可见性”的话题联系在一起不知道大家是否还可以保持大脑清晰??? 最近看到一个关于 ...
- 详解Java多线程编程中LockSupport
LockSupport是用来创建锁和其他同步类的基本线程阻塞原语. LockSupport中的park() 和 unpark() 的作用分别是阻塞线程和解除阻塞线程,而且park()和unpark() ...
- 录制Android屏幕软件——屏幕录像专家
本文不是技术文章,今天分享下录制屏幕的软件.这个软件的效果还是不错的,前提是需要Root.软件名字:屏幕录像专家 来源网址:http://www.mumayi.com/android-350180.h ...