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

Related Questions

Check out the source code here: http://www.savvissl.com/demo1/showcode.php check out the script here http://www.savvissl.com/demo1/testPDF.php Here
Check out http://fube.ca in any browser but Firefox and you'll see that the cloud
First check out this code. I seems like it should work for me, but
Please check out: http://gherkin.co.nz/refresh/ and click on the purple box that says 'Membership chest'
Check out the following snippet of HTML/Javascript code: <html> <head> <script type=text/javascript> var alerts
Check out the following screenshot: http://www.jesserosenfield.com/beta/descenders.png My problem is that descending (like the 7
Check out the simple code below : Public Class Form1 Private _items As List(Of
Check out this code. // Print object and recurse if iterable private static void
Check out http://cancerpreventionnetwork.org/participants.shtml and you can see that the header is dropped down on
Check out this code sample from Scott Guthrie's blog: http://weblogs.asp.net/blogs/scottgu/image_43366964.png Notice item is a

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.