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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:35:26+00:00 2026-05-29T03:35:26+00:00

I have a mess in git on 2 branches. Frontend contains a huge chunk

  • 0

I have a mess in git on 2 branches. Frontend contains a huge chunk of ongoing development work – it should have been fragmented into multiple branches, and it’s a little messed up.

Here is the situation – frontend is on the left, top of master is on the right:

| frontend 1: newest commit (to be pushed)  
| frontend 2: recent commit (to be pushed)  
| frontend 3: week-old commit (this was a temporary save of lots of ongoing work - it probably should have been a stash. This one cannot be pushed)  
|  
|  | master: this is the current state of the site
|  | master: previous commit
| /
|/ 
| master before `git branch frontend`

On branch frontend, I’d like to:

  • transfer frontend 1 and frontend 2 to master so they can be pushed now.
  • ‘cancel’ frontend 3 and move the code back to staging so I can make the commits properly (i.e. not in a huge dump of general work)

I am a beginner in git and I am worried I will do more damage (as I have already done) if I keep entering in commands trying to make it better. If you are able to help it would be much appreciated. Thank you.

  • 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-29T03:35:27+00:00Added an answer on May 29, 2026 at 3:35 am
    1. Do an interactive rebase to rearrange the order of the frontent commits so frontend 3 is the newest one.
    2. Then, while on frontend, do a git reset HEAD^ to “uncommit” frontend 3 while keeping the changes.
    3. git stash to stash the changes from frontend 3 as you meant to
    4. Switch to master.
    5. Merge frontend into master. (Or rebase, whichever it is you do.)
    6. Pop the stashed changes wherever and continue working.

    This assumes that the interactive rebase can in fact be performed cleanly – i.e. that the changes in frontend 3 are unrelated to the ones in frontend 1 and frontend 2.

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

Sidebar

Related Questions

I have a huge mess of a nested list that looks something like this,
We have a repository that was exported from subversion into git. This repository is
I have not had to mess with mailto links much. However I now need
I have this web application that has grown to an unmanageable mess. I want
I have the following code: public void post(String message) { final String mess =
Let's say I have a string holding a mess of text and (x)HTML tags.
I have some questions about development and deployment. I'll try to be clear: Notes:
We have a non-standard subversion respository that we would like to convert to Git.
On Git, say I mess up my commits, and I want to make the
I'm on a team using Git right now, and we have a pretty good

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.