Git checkout to first commit

How do I list all of my git branches after checking out my first commit?

For example

  • avoid any emailPrefix with git-multimail
  • How to disable automatic commits of .gitignore files?
  • I get an error when I try to authenticate my public key
  • Git: Two projects, each in a repo. Combine in new repo in sub-dirs with a single linear history
  • Correctly committing versioned, and built (minified) files to GitHub with Gulp.js
  • Git: Merge a branch but without some of the files I only need modified locally?
  • git log --oneline

    displays all of my branches:

    06c4b5c Version 3 of Hello World
    efa167f Version 2 of Hello World
    47a33c8 Hello World

    If I check out my first commit

    git checkout 47a33c8

    this message is displayed

    You are in ‘detached HEAD’ state. You can look around, make
    experimental changes and commit them, and you can discard any commits
    you make in this state without impacting any branches by performing
    another checkout…

    then if I do this:

    git log --oneline

    only the first commit is displayed now:

    47a33c8 Hello World

    My question is, if I did not know the location of HEAD was at 06c4b5c originally, how do I return to this location after checking out the first commit?

    Also, I get this error

    Error: pathspce ’06c4b5c’ did not match any file(s) known to git.

    when i try to checkout 06c4b5c

    git checkout 06c4b5c

  • git - setting path variable
  • Speed up Git Pushing/Pulling
  • git rebase a single commit
  • what's wrong with git clone? index-pack died of signal 99 error
  • How to stage only part of a new file with git?
  • How do I use git-new-workdir on windows?
  • One Solution collect form web for “Git checkout to first commit”

    You can use git reflog to see where you were before. You’ll see an entry like

    checkout: moving from master to 47a33c8

    Just do git checkout master to return to that branch.

    To list all the branches, use git branch -l.

    Git Baby is a git and github fan, let's start git clone.