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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:27:46+00:00 2026-05-10T22:27:46+00:00

If I check out a tagged version of my source code without creating a

  • 0

If I check out a tagged version of my source code without creating a branch, Git indicates that I’m not associated with any branch at all. It’s happy to let me make changes and check them in though. Where do those changes go? If I switch back to ‘master’ they disappear (overwritten by what was in master) and I can’t seem to find them again. What gives? If Git lets me commit changes against what’s essentially an anonymous branch, surely I can get them back?

  • 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. 2026-05-10T22:27:46+00:00Added an answer on May 10, 2026 at 10:27 pm

    Because your commit isn’t on any branch, you can’t see it in the working directory unless you checkout that specific commit, using its SHA1. You can find the commit by looking at the reflog which tracks changes in what you have checked out from the repo. If your tag was XXX you’ll see something like:

    $ git reflog 7a30fd7... HEAD@{0}: checkout: moving from master to XXX ddf751d... HEAD@{1}: checkout: moving from 96c3b0300ccf16b64efc260c21c85ba9030f2e3a to master 96c3b03... HEAD@{2}: commit:  example commit on tag XXX, not on any branch 7a30fd7... HEAD@{3}: checkout: moving from master to XXX 

    That tells you the SHA1 that you would have to checkout in order to see your commit in the working directory.

    $ git checkout 96c3b03 Note: moving to '96c3b03' which isn't a local branch If you want to create a new branch from this checkout, you may do so (now or later) by using -b with the checkout command again. Example:   git checkout -b <new_branch_name> HEAD is now at 96c3b03... example commit on tag XXX, not on any branch $ git checkout -b newbranch $ git branch                #lists all branches     feature1     master   * newbranch 

    This all seemed a little weird to me at first, until I realized that git checkout places all the project files as of a particular commit into my file system (working directory). In effect, the working directory acts as a browser on the local Git repository. So your changes haven’t been overwritten in the repository, they’re just not being shown in your working directory when you’ve checked out the master.

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

Sidebar

Ask A Question

Stats

  • Questions 121k
  • Answers 121k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Check out the inspect module: inspect.stack() will return the stack… May 12, 2026 at 12:32 am
  • Editorial Team
    Editorial Team added an answer It would be easier to use RTTI instead of explicit… May 12, 2026 at 12:32 am
  • Editorial Team
    Editorial Team added an answer Here you go, use this to get the date between… May 12, 2026 at 12:32 am

Related Questions

I have developed a kind of brochure website template that I base most of
I started using bazaar after a long camping in the svn field. I had
I've been using StarTeam for version control for some time, but am moving to
I'm struggling to understand something about GIT. We've got a repository with a number

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.