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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:36:22+00:00 2026-06-06T00:36:22+00:00

I screwed up a local branch on my computer by rebasing it to some

  • 0

I screwed up a local branch on my computer by rebasing it to some other branch. I wanted to rebase but I didn’t switch to the branch I wanted to rebase, and as a result I screwed up somebranch. I had no idea how to undo my rebase screwup in somebranch (if anyone knows it would be good to know for the future) so I decided that since I have somebranch on github I would just delete it locally and then pull it from github. I don’t know what I did but I screwed that up too. Eventually I found what I believe to be the right commands to recreate a deleted local branch by pulling it in from my remote origin:

git fetch origin somebranch:refs/remotes/somebranch
git checkout -b somebranch --track origin/somebranch

In gitk I can see there are three things now:
somebranch, remotes/somebranch, remotes/origin/somebranch

but all my other branches only show a local and one remote. example:
someotherbranch, remotes/origin/someotherbranch

I ran git for-each-ref and both ref/remotes/somebranch and ref/remotes/origin/somebranch point to the same commit.

My question is what is the difference between the two and how do I get rid of the ref/remotes/somebranch. I tried git update-ref -d remotes/somebranch but it didn’t work.

  • 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-06T00:36:23+00:00Added an answer on June 6, 2026 at 12:36 am

    You almost had it. Just add ‘refs’:

    git update-ref -d refs/remotes/somebranch
    

    You can confirm it’s gone by issuing, in the top level of the repository:

    ls .git/refs/remotes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, I have to admit I screwed up a little with CVS. I had
I tried the following but it just returns a screwed up array. T[,] ResizeArray<T>(T[,]
For some reason a website that recently went live has now completely screwed in
I removed the gitosis-admin folder, but naturally something is still screwed up when I
I think I screwed up my development environment the other day and I can't
I'd been working on something, and decided it was completely screwed...after having committed some
This might be a noob question, but I need help. I screwed up my
hi I'm using Github to push some files from my local server to my
I used git filter-branch and screwed something up and accidentally rewrote sections of the
I screwed up my last post. Lets see if I can get this one

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.