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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:04:41+00:00 2026-05-30T20:04:41+00:00

I’ve forked someone’s project and made some commits. I filled out a pull request,

  • 0

I’ve forked someone’s project and made some commits. I filled out a pull request, and it wasn’t accepted (either the change was not desirable, or the author rewrote the functionality to be in line with “his style”). Now I’m stuck with my local fork having a few extra commits that will never get to go into upstream. I can back out the change sets, but then I have twice as many extra commits and will have to cart them around forever. It’s just ugly!

What’s the best way to abandon these commits that nobody wants and get my fork back to tracking upstream? I know I can delete the fork completely and re-fork it, but this is really heavy-handed and I’d lose any other work I’m doing.

  • 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-30T20:04:42+00:00Added an answer on May 30, 2026 at 8:04 pm

    You can reset your repo state to an earlier commit. First figure out which commit you want to reset your repo to:

    git log
    

    To reset your repo to that state:

    git reset --hard <commit_hash>
    

    If you have a forked remote repo, you can push these changes back to it:

    git push -f <remote> <branch>
    

    You might want to change your workflow to make things easier in the future though.

    When I fork a repo and am making my own changes to it, I first set up two remotes. One remote will point to my forked repo (ex: origin), and add another remote points to the original repo that was forked from (ex: original_repo). So I might have something like:

    $ git remote
    origin
    original_repo
    

    I create a branch to do all my work in, ex: feature. When making a pull request, I do it from the feature branch to the original_repo master branch. If the pull request is rejected, like your example, you can just abandon this branch. If you want to work on more modifications, just create another branch from master and use that to work in.

    I also don’t commit or merge any local changes to the master branch. I only use the master branch to sync up with the original_repo master branch. ex:

    git checkout master
    git fetch original_repo
    git merge original_repo/master
    

    This ensures the master branch is always synched up with the original repo’s master branch. For example, if the pull request was accepted and merged in, when the fetch and merge happens, local master would also have all the ‘approved’ code used in the original repo.

    Basically use master to sync up with the original repo’s master and always branch from master when you want to make edits. Use those branches for your pull requests to the original repo.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is

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.