문제

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