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 --forceis 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= ...
随机推荐
- 【转】Android 关闭多个视图Intent.FLAG_ACTIVITY_CLEAR_TOP用法
如果已经启动了四个Activity:A,B,C和D.在D Activity里,我们要跳到B Activity,同时希望C finish掉, 可以在startActivity(intent)里的inte ...
- 【Codeforces 670C】 Cinema
[题目链接] http://codeforces.com/contest/670/problem/C [算法] 离散化 [代码] #include<bits/stdc++.h> using ...
- 查看mysql是否安装成功和mysql的版本信息
转自:https://blog.csdn.net/hellocsz/article/details/81241204 使用快捷键win+R打开 进入mysql的安装目录下的\bin(本人安装路劲为E: ...
- codeforce 杀题计划
先尽量做Div 1 A B 想做难题时做C 全天学竞赛时每天至少两道Div2 (算法数据结构没学的先过,题面很长的......也先过 我的英语啊...)
- HttpPostedFileBase 基类
public void uploadDocMentSave(string Type) { if (Request.Files.Count > 0) { Htt ...
- phonegap在eclipse上的安装
1.首先安装好eclipse 2.下载安装好sdk 3.下载安装好adt 4.在这个地方下载好phonegap的包,https://codeload.github.com/phonegap/phone ...
- Educational Codeforces Round 45
A. 一个小模拟 不解释 //By SiriusRen #include <bits/stdc++.h> using namespace std; long long n,m,a,b ...
- js 中的定时器
在js中的定时器分两种:1.setTimeout() 2.setInterval() 1.setTimeOut() 只在指定时间后执行一次 /定时器 异步运行 function hello(){ al ...
- 【MySQL】二进制分发安装
操作系统:Red Hat Enterprise Linux Server release 6.5 Mysql安装包:mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz ...
- php入门学习笔记
学习笔记[6.5-6.13] 1.常用命令 打开数据库格式: mysql -h主机地址 -u用户名 -p 重启nginx:sudo /etc/init.d/nginx restart或者service ...