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
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top