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 7023239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:41:10+00:00 2026-05-27T23:41:10+00:00

I have two branches: master and bonbon Currently they are at the same point.

  • 0

I have two branches: master and bonbon

Currently they are at the same point. The bonbon was a side project that was going to be released but has now been put on hold. I would like to revert the master branch to a point before the bonbon branch was created. However I would also like to keep some of the changes I made in the bonbon branch and in the future it might be required to merge back in the bonbon branch so I don’t want to lose those changes. What is the best way to revert the master branch and pick out the required changes.

I tried to reset the branch but when I commited and push the changes it failed and I’ve ended up merging the two branches together again! Should I have done a hard push (edit: i meant force push)?

  • 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-27T23:41:10+00:00Added an answer on May 27, 2026 at 11:41 pm

    My guess is that by resetting the branch you meant something like this, while on the master branch:

    git reset --hard some_ref_below_master
    

    In this case, a push will fail, because a push on a particular branch, by default, requires that the merge (of the remote branch with your local branch) is a fast forward, that is, that the remote’s ref is an immediate parent to your local ref.

    So, you have no other choice than to force the push — either with git push --force, or with git push +localref:remoteref (the local ref spec can be omitted if the remote ref has the same name).

    For instance:

    git push remote +master # force local and remote master on the same commit
    git push +foo:bar # force remote's bar ref to point to the same commit as local's foo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two branches to my project, master and test branches . when I'm
Say I have a project with two branches master and dev. I have a
I'm using Git on a new project that has two parallel -- but currently
I have two branches master and exp i tried to cherry pick some of
I have a git repository (at github.com) with two branches: master and gh-pages. I
Suppose I have two branches of a project IMClient-MacOS and IMClient-Windows, and their code
I'm running SourceSafe and I have two branches of my code. I'm currently using
Given that two branches have diverged and a specific commit from one branch (and
I have two branches in my Git repository: master seotweaks (created originally from master
I have two branches: master and bug1. I checked out bug1, did bunch of

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.