How to revert the code/files that have been merged to the remote Repo

原创 2017年11月15日 14:41:35

I pushed the wrong code to the remote Repo and just want to back out the merge.The common way is to use git revert

git revert [the commit you want to back out]

But sometimes I just want to back out several specific files.I do not find a one command way to fix it.Here is the way I use:
- Firstly revert all of the commit:

git revert [the commit you want to revert]
  • Then make the revert files to the workspace.
  • cancel the modification of the files you don’t want to back out
git checkout -- [the files needed cancel]
  • At last just remains the files you want to revert.

相关文章推荐

Git: How to revert a merge commit that's already pushed to remote branch?

revert a merge commit
  • wwq518
  • wwq518
  • 2016年08月10日 23:28
  • 181

How to create .lib file when you only have .dll and .h files

1. 原文地址:http://www.codeproject.com/KB/cpp/libfromdll.aspx 这篇讲解了DEF文件地结构,但附件中的工程编译不了。   2. Microso...

How to Copy asm files between remote ASM instances using ASMCMD command

 Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.2 - Release: 11.1 to 11.2  11g new...

If I have been able to see further, it was only because I stood on the shoulders of giants.

Quite elegant languages: to learn, to write an essay . As love... 我不知道在别人看来,我是什么样的人;但在我自己看来,我...

You have tried to change the API from what has been previously approved

Android编译错误:You have tried to change the API from what has been previously approved.  android...
  • longkg
  • longkg
  • 2013年01月26日 16:03
  • 268

Android编译错误:You have tried to change the API from what has been previously approved.

android SDK中有些JAVA类是开放的,有些是不开放的,API同样如此。这里所谓开放的类或API,只是javadoc的范畴,并不是java中public和private,也就是说,对于源码的编...

You have tried to change the API from what has been previously approved.

Android编译错误:You have tried to change the API from what has been previously approved.  android...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:How to revert the code/files that have been merged to the remote Repo
举报原因:
原因补充:

(最多只允许输入30个字)