I have a situation where I:
(1) Merged a patch by user X
(2) Made some changes to some other code and committed.
Now I want to push my commit to the server. However, when I do
git push origin HEAD:refs/for/mybranch
I get an error regarding the patch that I merged, saying that I am not the author. Is there a way to do what I’m trying to accomplish? If not, is there a way to save my commit, then revert everything and push my commit back in?
Second revision:
Revised answer:
Ok, then you need to reset one step more back in the history:
Original answer:
You could reset your head so your commit is moved to the index:
Now git will be in the state of the merged code and your changes uncommitted and ready to be staged again. Now you can stash these changes:
Now you can push up the merged changes from X and after that apply the stash, add and commit: