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

  • Home
  • SEARCH
  • 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 8439339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:59:05+00:00 2026-06-10T07:59:05+00:00

Here are my commits: A B C With C being the current commit. I

  • 0

Here are my commits:

A B C

With C being the current commit. I want things to look like this on origin:

A B C A

So A is my current commit, but B and C are retained. I currently have the repo cloned with C being the current commit. What do I need to do next to get origin how I want it?

  • 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-10T07:59:07+00:00Added an answer on June 10, 2026 at 7:59 am

    Commits ‘B’ and ‘C’ are progressive states of the branch’s history. To reset to ‘A’ without losing ‘B’ or ‘C’ locally, just use a new branch on origin:

    git checkout -B new-branch master
    git reset --hard <A_commit_hash>
    git push origin new-branch
    

    ‘B’ and ‘C’ will be retained on ‘master’, so you can git cherry-pick <commit_of_B_or_C> or git merge master without trouble.

    If you really want ‘B’ and C’, but want to reset ‘master’ to ‘A’, and have thought through the consequences of forcibly overwriting your remote:

    git branch archived-master master ;# create 'archived-master' branch
    git reset --hard A ;# reset master to 'A' state
    git push -f origin master ;# overwrite remote's master
    

    That’ll save ‘B’ and ‘C’ locally on the ‘archived-master’ branch.

    I would avoid git revert for this. Revert commits make commands like git bisect and git rebase more difficult, and if you ever want to reuse ‘B’ and ‘C’ it’s harder for a human to parse the history.

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

Sidebar

Related Questions

Okay here's my situation. I have the following branches development development-kirby (270 commits ahead
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
new git user here. I want to use git, but i'm in an SVN
Question title might be meaningless, but I tried. :) Here's my situation: I have
Here is the code in a function I'm trying to revise. This example works
Here is what I am currently doing. PHP echo's out the recent post in
I've followed the guides helpfully linked here: iPhone - debugging "pointer being freed was
Something's wrong with the PUT action here, the form gets processed but the updated
Here's the situation. I'm working on the master branch. I create file1 and commit.
Is it possible to DETECT whether the current stored procedure is being called by

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.