Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5973297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:46:50+00:00 2026-05-22T20:46:50+00:00

I have a situation where I: (1) Merged a patch by user X (2)

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:46:50+00:00Added an answer on May 22, 2026 at 8:46 pm

    Second revision:

    git reset --soft HEAD^ (to undo your commit)
    git stash (to stash away your changes)
    git reset --soft HEAD^ (to undo the merge commit from X)
    git stash (stash away X)
    git stash apply stash@{1} (apply your changes)
    git add . (add and commit and push ..)
    git commit -m "some changes"
    git push
    git stash apply stash@{0}
    

    Revised answer:

    Ok, then you need to reset one step more back in the history:

    git reset --soft HEAD^ (to undo your commit)
    git stash (to stash away your changes)
    git reset --hard HEAD^ (to undo the merge commit from X)
    git stash apply (apply your changes)
    git add . (add and commit and push ..)
    git commit -m "some changes"
    git push
    git merge featureX (re merge the changes from X)
    

    Original answer:

    You could reset your head so your commit is moved to the index:

    git reset --soft HEAD^
    

    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:

    git stash save "stashing commit for changes from X"
    

    Now you can push up the merged changes from X and after that apply the stash, add and commit:

    git push
    git stash apply
    git add .
    git commit -m "some stuff"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the situation: On a particular branch, some changes have been merged in from
I have situation where a user can manipulate a large set of data (presented
I have situation like this: user submits form with action='/pay' in '/pay' I have
We have a situation in our product where for a long time some data
I have such situation: We have a website which code is not hosted on
I am in a situation where I basically want to be able to have
Suppose we have the following situation in Git: X---Y feature / A---B---C---D edge Now
Consider a situation. I want to commit a changed file to SVN and see
Situation I've never before used git or any other version control. Now I've got
I want to have the following version structure: (my private changes to 0.1.0) -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.