I work with a project, it have 3 branches, master, developer and feature/configurations. I merged feature/configurations to developer but an error occurred in branch "Developer", my question is how to reverse or remove merge such that branch will not have problems?.I read about rebase and revert command but I don't know the right way to use it. I know the tag or ID the last good commit and merge.
Asked
Active
Viewed 30 times
-3
-
*"an error occurred"* - What error? Note that it's possible to have merge conflicts. In some cases you'll have to perform the merge yourself using a merge tool. And even if git handles it for you, it is still a good idea to test thoroughly after the merge and/or review the code after the merge. – GolezTrol Nov 07 '15 at 08:11
-
try `git reset --hard` – Nguyen Sy Thanh Son Nov 07 '15 at 08:12
-
@GolezTrol the merge I used to use the Merge Request in Gitlab, but after the merge it did not work the project, it's developed in ASP.net and C#. When I test the project of branch feature/configurations works fine. I did the merge to a remote repository. – carson314 Nov 07 '15 at 08:31
1 Answers
1
If you never pushed and your merge commit is the last one you have done (and you don't have any current modification in that branch):
git reset --hard @~
If not, see "Delete commits from a branch in Git".
I know the tag or ID the last good commit and merge.
git rebase -i <last_good_commit>
In the interactive session, drop the line with the bad merge commit.