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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:50:28+00:00 2026-06-10T06:50:28+00:00

I have a git repository. When I do ‘git branch’, it said $ git

  • 0

I have a git repository.
When I do ‘git branch’, it said

 $ git branch
* com-2.1-SS

and then I do ‘git log’, i get a list of my commit

$ git log
commit ff878926b78614e8bf6af161da06070618e9ff6b

commit 3ffda8cec60a74a718fb25fb7a9fe4b3c4381137

commit bf6bb3427d8031d8e172c3b8b7909c8580e929cd

So I want to check out my repository to 3ffda8cec. So I did ‘git checkout 3ffda8cec’.

So far so good. It works and I get want I want.

But my question is how can I get back to com-2.1-SS?
i.e. reverse the fact that I ‘git checkout 3ffda8cec’

When I do ‘git branch’, it said

$ git branch
* (no branch)

When I do ‘git checkout git checkout com-2.1-SS

error: pathspec 'com-2.1-SS' did not match any file(s) known to git.
  • 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-10T06:50:29+00:00Added an answer on June 10, 2026 at 6:50 am

    git reflog will show you the different values a branch tip had and you can checkout it to go back to a previous state.

    Your case is easier since you still know now that the sha1 of com-2.1-SS before the git checkout was ff878926b78614e8bf6af161da06070618e9ff6b (which is basically what git reflog do) so you can directly do:

    git checkout ff878926b78614e8bf6af161da06070618e9ff6b
    

    Althoug I don’t understand from your description at which point your branch was deleted, you can recreate your branch after the checkout with:

    git checkout -b com-2.1-SS
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a git repository (at github.com) with two branches: master and gh-pages. I
I have a Git repository which I have started to develop on master branch
I have a Git repository that has branch (local and remote) that has become
I have a git repository on unfuddle.com. I've been working locally on my windows
I have a Git repository whose oldest commit is version 6.8.2 (it is tagged
I have a Git repository (originally CVS, then SVN, now Git) containing a Rails
I have a Git repository on a remote server, but how do I get
I have a git repository. I want to create a branch for release snapshots.
I have a Git repository which has a master branch. Now I want to
I have a git repository that is just a directory tree (/myprogram/src/com/mycompany/test) with some

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.