您的位置:首页 > 其它

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

2017-11-15 14:41 471 查看
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 revert
相关文章推荐