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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:48:37+00:00 2026-05-23T07:48:37+00:00

I am relatively new to git and github. I made some changes on my

  • 0

I am relatively new to git and github. I made some changes on my master branch, and instead of doing “git add .” with my master branch and going through the process to push these changes, I did ‘git checkout -b xyz’.

I am now on a new branch xyz but need to get to the master branch that I haven’t done “git add .” on yet, and I need to push my old branch to github. How can I go back to the master branch that I haven’t pushed yet?

  • 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-23T07:48:38+00:00Added an answer on May 23, 2026 at 7:48 am

    What you have done is bascially creating a new branch and moving to that branch.

    If you want to go back to the master branch you need to do:

    git checkout master
    

    And since you don’t need the xyz branch anymore you could also delete it:

    git branch -D xyz
    

    Finally, in order to push your latest changes to the master branch of your remote (which I suppose is called origin) you need to do:

    git add .
    
    git commit -am "Your commit message"
    
    git push origin master
    

    Edit

    Like I told you on one of my replies, I think you should take the time to read at least the first chapters of the Pro git book by Scott Chacon. It is really worth it and it will help you understand the basics of how git works.

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

Sidebar

Related Questions

I 'm relatively new to git and and having some problems early on. I've
DISCLAIMER: relatively new to Flex/AS3, I might be missing something obvious. After doing some
I am relatively new to Git, and I'm still not very comfortable with it.
I'm relatively new to Git, and want to get advice on best practices for
Relatively new to JQuery. I've got some code that does a banner swap with
Introduction I'm relatively new to C++. I went through all the basic stuff and
I am relatively new with sql and I need some help with some basic
I am relatively new to using Git. This is what I've done so far:
im relatively new to ROR, and would like some help with the following code.
I'm relatively new to Git, but I've found it so easy to work with

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.