[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 ...
随机推荐
- 爬虫IP被禁的简单解决方法
爬虫以前听上去好厉害好神秘的样子,用好了可以成就像Google.百度这样的索索引擎,用不好可以凭借不恰当的高并发分分钟崩掉一个小型网站.写到这里想到12306每年扛住的并发请求量,觉得好牛逼. 爬虫和 ...
- jQuery $('div>ul') $('div ul'
$('div>ul')是<div>的直接后代里找<ul>: 而$('div ul')是在<div>的所有后代里找<ul>.
- 计算机意外地重新启动或遇到错误。windows安装无法继续。若要安装windows 请单击 确定 重新启动计算机
快安装完系统时遇到提示:计算机意外地重新启动或遇到错误.Windows 安装无法继续.若要安装Windows,请单击“确定”重新启动计算机,然后重新启动安装”.如下图所示: 解决办法: 当出现如上提示 ...
- git 自动转换行符的坑爹案例
本人写的脚本都是在unix上运行的,但是编写有时候喜欢使用Git拉去到windows的ide进行编写,毕竟我的unix只有命令行的没有ide, 殊不知有一天我的sh执行时出现错误 -bash: ./d ...
- TrinityCore3.3.5环境搭建
说起TrinityCore,可能知道的人不多,但是说起MaNGOS(芒果)知道的人应该就不少了.MaNGOS是一个魔兽私服服务器端,TrinityCore继承自TrinityCore并且做了优化,一直 ...
- having只用来在group by之后,having不可单独用,必须和group by用。having只能对group by的结果进行操作
having只能对group by的结果进行操作 having只能对group by的结果进行操作 having只能对group by的结果进行操作 having只用来在group by之后,havi ...
- JAVA变成把一个整数分解成多个质数的积
/* * TestTengXun.java * Version 1.0.0 * Created on 2017年12月2日 * Copyright ReYo.Cn */ package reyo.sd ...
- POP缩放动画
POP缩放动画 效果 源码 https://github.com/YouXianMing/Animations // // SpringScaleViewController.m // Animati ...
- [Android Security] 反编译常用工具
copy : https://down.52pojie.cn/Tools/Disassemblers/
- Chocolatey 简介(软件自动化管理工具)
一.Chocolatey 管理Windows软件的明智方法 1.建立在技术的无人值守安装和PowerShell.建立在技术的无人值守安装和PowerShell. 2.轻松管理Windows软件的所有方 ...