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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:29:20+00:00 2026-05-31T04:29:20+00:00

I was working on a git branch other than master. I don’t remember its

  • 0

I was working on a git branch other than master. I don’t remember its name. When I was done with it, I did

git add .
git commit -am "foo"

I didn’t push the commits.

I switched to master git co master. I don’t know how to get back to my branch and commit the changes…

  • 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-31T04:29:22+00:00Added an answer on May 31, 2026 at 4:29 am

    Executing git branch will list all your local branches. Then you can check out the branch you want:

    git branch
    git checkout branch-name
    

    Once you have everything committed correctly on the branch, you can merge it back to master:

    # while on your feature branch
    git commit -m "Finishing my feature"
    git checkout master
    git merge branch-name
    git push origin master
    

    Note that you aren’t pushing from your feature branch, but rather merging your feature branch to master and then pushing master. Feature branches typically aren’t tracking a remote repository, so there’s nowhere for them to push to.

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

Sidebar

Related Questions

Here's an example: >git status # On branch master nothing to commit (working directory
I am working on a git repository with a master branch and another the
Say I have a git repository and I've been working on master, can I
I've been working in a git branch on one portion of a rails site.
I had a working iOS project, and whilst working on a git branch, the
I've done a fair bit of work (Your branch is ahead of 'origin/master' by
Let's say that there are two people working on a git branch, they check
Use case: -Visual Studio is open -Master branch is clean (confirmed with git status)
While working with git-svn, and a 'typical' svn repo /trunk, /branches/..., /tags/... How do
I accidentially discard my changes on files in my local working tree via git

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.