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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:56:53+00:00 2026-06-17T12:56:53+00:00

I was working off of master and made some bad commits C & D

  • 0

I was working off of master and made some bad commits C & D.

A --- B --- C --- D (MASTER)

So I decided to restart the work from the known good commit B because I thought it would be easier than to try and find the mistake inside the C and/or D commits. But I also wanted the option of going back to D if the new attempt didn’t work out for whatever reason. So I first created a detached HEAD pointing at B and then created a new branch (RETRY). My git repo now looks like this:

A --- B --- C --- D (MASTER)
       \
        \
         E --- F (RETRY)

As it turns out it was easier to just restart work at B and my commit F works wonderfully. So now my question is: how do I make MASTER point to F without merging with all the work done in C and D (but still keeping the C and D commits around in case I want to refer to them in the future)? I want to end up with:

A --- B --- C --- D
       \
        \
         E --- F (MASTER)
  • 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-06-17T12:56:54+00:00Added an answer on June 17, 2026 at 12:56 pm
    git checkout master
    git branch old
    git reset --hard retry 
    

    Will create (but not switch to) a new branch (called old) which points to the same commit as master and then move master to point to the same commit as retry.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an autocompletetextview that will work off of a key value system,
I have: folder_a/app_1.0 folder_b/app_1.1 And let's just say I'm working off of the master
I'm working on a master's thesis and want to demonstrate how bad a malicious
I'm currently working on http://dawtano.com/pp/ , and I want to show off my work
I'm working on a git repository that has a branch off of master, we'll
I am working off the base navigation template which has a master-view holding the
I'm working off a relatively clean OS X install. I had Xcode, but removed
I'm working with an off-the-shelf application at my company and there is an interesting
I've been working on and off with a team that's developing an iPhone app.
First off I should say that I don't have any experience in working with

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.