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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:07:14+00:00 2026-05-17T21:07:14+00:00

Myself and one other developer had been merging and pushing our work to a

  • 0

Myself and one other developer had been merging and pushing our work to a non-master branch called toolwork. That way, we didn’t impact the rest of the team. My topic branch was called DPM-93 and my git workflow was this.

# do some work
git checkout DPM-93
git commit -m "did some work"

# catch up
git checkout toolwork
git pull origin toolwork

# rebase my topic branch
git checkout DPM-93
git rebase toolwork

# merge and push my changes
git checkout toolwork
git merge --no-ff DPM-93
git push origin toolwork

That was mostly working fine until I accidently issued these git commands

git checkout toolwork
git pull origin master

At that point, a bunch of new stuff showed up in branch toolwork and I’m not sure how to get rid of it short of deleting my workspace and re-cloning from the repo.

Is there any way to back this out to the state before the pull?

  • 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-17T21:07:15+00:00Added an answer on May 17, 2026 at 9:07 pm
    git reset --hard ORIG_HEAD 
    

    From the git reset man page (if you just did the pull):

    Undo a merge or pull

    $ git pull                         (1)
    Auto-merging nitfol
    CONFLICT (content): Merge conflict in nitfol
    Automatic merge failed; fix conflicts and then commit the result.
    $ git reset --hard                 (2)
    $ git pull . topic/branch          (3)
    Updating from 41223... to 13134...
    Fast-forward
    $ git reset --hard ORIG_HEAD       (4)
    
    1. Try to update from the upstream resulted in a lot of conflicts; you were not ready to spend a lot of time merging right now, so you decide to do that later.
    2. “pull” has not made merge commit, so “git reset --hard” which is a synonym for “git reset --hard HEAD” clears the mess from the index file and the working tree.
    3. Merge a topic branch into the current branch, which resulted in a fast-forward.
    4. But you decided that the topic branch is not ready for public consumption yet.
      “pull” or “merge” always leaves the original tip of the current branch in ORIG_HEAD, so resetting hard to it brings your index file and the working tree back to that state, and resets the tip of the branch to that commit.

    See HEAD and ORIG_HEAD for more.

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

Sidebar

Related Questions

I have two developer's account, one for myself and other for my partner. Initially
There are several people about (myself being one of them) who have been developing
So I purchased myself an iPhone ... everybody has one ... so I figured
I seem to often find myself wanting to store data of more than one
I am writing a small app to teach myself ASP.NET MVC, and one of
I'm programming an online game for two reasons, one to familiarize myself with server/client
I have been through the Apple Developer guides and tutorials and I been through
So I recently had a tree conflict when trying to merge a branch into
I've always been bothering myself with a question: Javadoc, Doxygen and much more.. is
Myself and a colleague have a dispute about which of the following is more

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.