IDEA git commit push revert
Revert uncommitted changes
You can always undo the changes you've done locally before you have committed them:
- Open the Version Control tool window (Alt+9) and switch to the Local Changes tab.
- In the active changelist, select one or more files that you want to revert, and select Revert from the context menu, or press Ctrl+Alt+Z. All changes done to the selected files since the last commit will be undone, and they will disappear from the Local Changes view.
Undo the last commit
IntelliJ IDEA allows you to undo the last commit in the current branch (i.e. HEAD):
You cannot undo a commit if it was pushed to a protected branch, i.e. a branch to which
push --force
is not allowed. You can configure the list of protected branches in the Settings dialog (Ctrl+Alt+S) under Version Control | Git.- Open the Version Control tool window (Alt+9) and switch to the Log tab.
- Select the last commit in the current branch and choose Undo Commit from the context menu.
- In the dialog that opens, select a changelist where the changes you are going to discard will be moved. You can either select an existing changelist from the Namedrop-down list, or specify the name of a new changelist (the commit message is used by default).
- Select the Set active option if you want to make the changelist with the changes you are about to discard the active changelist.
- Select the Track context option if you want IntelliJ IDEA to remember your context and reload currently opened files in the editor when this changelist becomes active.
Revert a pushed commit
If you notice an error in a specific commit that has already been pushed, you can revert that commit. This operation results in a new commit that reverses the effect of the commit you want to undo. Thus, project history is preserved, as the original commit remains intact.
- Locate the commit you want to revert in the Log view, right-click it and select Revert from the context menu. The Commit Changes dialog will open with an automatically generated commit message.
- If the selected commit contains several files, and you only need to revert some of them, deselect the files you do not want to touch.
- Click Commit to commit a changeset that reverts changes to the selected files in this particular commit
信息来自:https://www.jetbrains.com/help/idea/using-git-integration.html#revert-local-changes
IDEA git commit push revert的更多相关文章
- [Git] How to revert one file changes from one commit
Many times we might changed one file which we don't intent to do... but it was too late, until we fo ...
- [Git] git revert ( revert commit 和 revert merge)
转载自:http://blog.csdn.net/qinjienj/article/details/7621887 我们难免会因为种种原因执行一些错误的commit / push,git提供了reve ...
- git 命令的使用(一) add commit push pull
一. commit 和 push 的区别 git作为支持分布式版本管理的工具,它管理的库(repository)分为本地库.远程库.git commit操作的是本地库,git push操作的是远程库. ...
- 02_创建Git仓库,克隆仓库,git add,git commit,git push,git pull,同行冲突,不同行冲突的结局方案,git mergetool的使用
1 创建Git资源库,残酷目录信息 创建git资源库的命令: git init –bare 仓库名称 (其中-bare表示的意思是空的库的意思) 进入E:\software\repository\gi ...
- 如何解决无法成功git commit 和git push
如何解决无法成功git commit 和git push 20155324王鸣宇.20155314刘子健 git add . 成功了 但是git commit无法实现. 我先尝试了卸载git 重新下载 ...
- Git commit/pull/push的操作步骤
1.操作步骤需要严格执行如下顺序:commit->pull->push 2.commit:将代码提交到本地仓库. 3.pull:将远程仓库代码同步到本地仓库.如遇冲突,解决冲突,重复com ...
- Git CMD连接,管理(remote,add,commit,push)github repository
git initmd testcd testgit statusgit add test //git add test/a.txtgit status git remote add origin g ...
- git<Commit和Push的区别>
git作为支持分布式版本管理的工具,它管理的库(repository)分为本地库.远程库. git commit操作的是本地库,git push操作的是远程库. git commit是将本地修改过的文 ...
- 简单的处理git add ,git commit,git push 脚本
创建脚本lazygit.sh #!/bin/bash # 一次性处理git提交 #branch_name=`git symbolic-ref --short -q HEAD` branch_name= ...
随机推荐
- 那些有意思的Github
https://github.com/ngosang/trackerslist Linux下那些有趣的命令.. https://www.linu&xp&robe.com/linux-i ...
- poj1200Crazy Search(hash)
题目大意 将一个字符串分成长度为N的字串.且不同的字符不会超过NC个.问总共有多少个不同的子串. /* 字符串hash O(n)枚举起点 然后O(1)查询子串hash值 然后O(n)找不一样的个数 ...
- Gym - 101982B 2018-2019 ACM-ICPC Pacific Northwest Regional Contest (Div. 1) B. Coprime Integers Mobius+容斥 ab间gcd(x,y)=1的对数
题面 题意:给你 abcd(1e7),求a<=x<=b,c<=y<=d的,gcd(x,y)=1的数量 题解:经典题目,求从1的到n中选x,从1到m中选y的,gcd(x,y)=k ...
- [Swift通天遁地]三、手势与图表-(6)创建包含三条折线的线性图表
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- 牛客小白月赛15 C 表单 ( map 使用)
链接:https://ac.nowcoder.com/acm/contest/917/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言52428 ...
- Akka源码分析-故障恢复
Actor故障恢复是akka中非常重要的内容,在之前的博客中虽然有介绍,但都是杂糅在其他知识点的细节中,本博客将单独介绍这一部分的故障恢复.为了简化分析的单独,本文只研究用户的actor故障恢复的步骤 ...
- CSS元素超出部分滚动,并隐藏滚动条
方法一, 利用 css 3 的新特性 -webkit-scrollbar, 但是这种方式不兼容 火狐 和 IE <!DOCTYPE html> <html> <head ...
- Sublime Text Version 3.0,Build3143注册码
1.打开sublime text软件2.Help->Enter License3.复制以下BEGIN LICENSE和END LICENSE之间的部分,粘贴进去.(注意:不要复制BEGIN LI ...
- cglib动态代理(即AOP)
Computer.java package com.wh.spring_aop; public class Computer { public void playLOL(){ System.out.p ...
- webHttpBinding+wsHttpBinding+basicHttpBinding的区别 (转)
1. webHttpBinding (web AJAX/JSON)2. wsHttpBinding (ASP.NET client) 3. basicHttpBinding (Silverlight) ...