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
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:
Then make the revert files to the workspace.
cancel the modification of the files you don’t want to back out
At last just remains the files you want to 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.
相关文章推荐
- How to check whether the patches have been applied or not
- How to limit an array of similar hashes to those that have more than one of the same key:value pair
- How can I recover a file that I deleted in my local repo from the remote repo in Git?
- How to be sure that message via socket.io has been received to the client?
- Git: How to revert a merge commit that's already pushed to remote branch?
- How to solve the problem : "You have been logged on with a temporary profile"
- How to use the date format that has been setup as default in Settings?
- How to use "vi" edit the docs or source code files
- Every student in every school should have the opportunity to learn to code
- How to prepare a workstation for imaging that includes the NS Agent
- How to deal with the Unmerged paths
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL 完美解决
- You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server versi
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- find the top-10 query plans that have been recompiled the most.
- rror Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnec
- ubuntu 错误:E: Some index files failed to download. They have been ignored, or old ones used instead.
- How to run the .net code within the Sql server
- How to Copy asm files between remote ASM instances using ASMCMD command