Linked Questions
11 questions linked to/from Rollback a Git merge
0 votes
0 answers
98 views
Unmerge a branch [duplicate]
I merged a branch in dev using vscode: git merge branch1 I want to unmerge this branch1 from dev and have the original code that was in dev before merging the branch. I tried pulling the dev branch's ...
4978 votes
35 answers
3.5m views
Undo a Git merge that hasn't been pushed yet
I accidentally ran git merge some_other_branch on my local master branch. I haven't pushed the changes to origin master. How do I undo the merge? After merging, git status says: # On branch master # ...
22 votes
13 answers
5k views
What can SVN do that Git can not?
I am currently deep into Git before ever mastering SVN. Its my first serious source control management system learning experience. I wonder about the opportunity-cost of not learning (or even de-...
34 votes
2 answers
77k views
How to undo a merge in GitHub
I have been working in PhpStorm on a dedicated branch, but when pushing to github, I inadvertently merged to the master branch. How would I undo the merge both in github and locally? The github ...
3 votes
3 answers
1k views
is there an option to revert a commit in an interactive rebase?
Our git branch pipeline is dev -> test -> uat -> master where test, uat and master are protected branches. I have some faulty merges done uptil uat. I would like to revert them. I tried ...
2 votes
1 answer
2k views
How to deal with accidentally merging master into feature branch?
I tried to resolve merge conflict in a wrong repository, so I merged the master branch into a feature branch in the repository, which I shouldn't have done. How can i undo/correct that mistake? Can ...
0 votes
1 answer
1k views
Git revert grey commit in bitbucket
On bitbucket I have merged a Pull request which had 2 commits. I didn't squash merge them. Other than the 2 commits, I find that there is an additional "grey commit" with the total changes of the 2 ...
0 votes
0 answers
887 views
Git rollback merge commit
In a repo, I have the main master branch that the team uses. I have developed a new feature on another branch called feature. I then merged this feature branch with master using: git checkout master ...
1 vote
1 answer
188 views
Revert everything that I have done which not pushed yet [duplicate]
I'm looking for revert everything which not pushed into the remote branch. I have used git revert -m 1 <merge commit hash> as in this question on StackOverflow but it is only reverting one ...
0 votes
1 answer
44 views
Git: remove entire PR from code to test locally
I see a bug in the code repository, most likely coming from my colleague's PR. To confirm this I want to remove his suspect PR, rebuilt the code without it and see if that fixes the bug. His PR has ...
0 votes
0 answers
40 views
Remove all the changes made by a particular branch (developer)
We 4 developers work on a single project and merge our code into development. Now I want to undo all the changes made to my particular developer branch. How can I do that? And I want the code of all ...