How to revert back the last merge in GIT
I committed my changes to local master, I merged my changes with the works of another developer who was also working on master, she made few commit before my commit. Finally I made a merge of my work to hers, now it happens that my commit overwrote her changes in the repository. It is there anyway I can revert back the merge?
o - bad merge here that I want to get rid off |\ | o her commit 1 yesterday | o her commit 2 yesterday | o her commit 3 yesterday o | my commit today \ | o
One Solution collect form web for “How to revert back the last merge in GIT”
You can just move back your master branch one step with
git reset <SHA> (see manpage), where <SHA> identifies the commit before the current one (the one you labelled “my commit today”).
After that, you can look into the git merge manpage for more info on how to prevent the overwriting of changes.