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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:31:13+00:00 2026-06-13T17:31:13+00:00

Yesterday I did my first fork on github. I modified something and then made

  • 0

Yesterday I did my first fork on github.

I modified something and then made a pull request to the original repo.

Then I’ve discovered that i did something wrong, now I want to sync my fork to the original repo so that all the changes i did (creating new files, modified some..) will be deleted.

I tried with

git fetch upstream
git merge upstream/master

and the changes made on the original repo in the meantime get synced to my fork but the changes i did remained in my fork!

I want my repo to be the same as the original one.

  • 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-13T17:31:14+00:00Added an answer on June 13, 2026 at 5:31 pm

    You can fix your fork by adding a remote to the original repo, fetch from there, reset your branches to match the ones pulled, then force push the branches to your fork.

    Assuming your forked repo is represented by origin, here is an example with master as the only branch you have:

    git remote add upstream http://github.com/original.git
    git fetch upstream
    git reset --hard upstream/master
    git push -f origin master
    

    now master will be in the same place in both repos. When you do a merge, you either move the reference forward (called a fast-forward merge) because nothing existed on your side, or you make a new commit as there are changes to both. Reset is the answer here if you want to throw away your commits – not merge.

    If you have other branches that you want to reset back to where they are on the initial repo you can do it without checking them out with:

    git push -f . upstream/feature1:feature1
    git push -f origin feature1
    

    the . says push within the same repo. It’s a clever way to move a branch pointer without having to checkout the branch. The colon syntax in push means <source>:<destination>. If :<destination> is omitted, it implies the same name which is why you don’t often see the syntax with push examples. A more common example is when you push a local branch to a remote one that has a different name: git push origin myexperiment:dev would update the dev branch on the remote to what myexperiment points to.

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

Sidebar

Related Questions

I just publicated yesterday my first android application. I did not tested on android
I need to find out the amount of people that made their first post
I have a git branch (called v4), that was made from master just yesterday.
I faced today my first mercurial problem. I was in my repo, I modified
I am new to RabbitMQ. I just started yesterday. I did few spikes on
Yesterday I updated to firefox 13 and I notice that this property is not
I saw some code yesterday in this question that I had not seen before,
Only yesterday did I need to animate the border color of an HTML div
I started learning JavaScript last week, I saw this code yesterday and I did
On my first day of work with html I built a navigation bar yesterday

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.