Skip to content

Instantly share code, notes, and snippets.

@deostroll
Created August 3, 2015 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deostroll/1b1dbbed7ad93e1738c4 to your computer and use it in GitHub Desktop.
Save deostroll/1b1dbbed7ad93e1738c4 to your computer and use it in GitHub Desktop.
$ git log --oneline
09232b1 initial commit
f1edfaf initial commit
ddb9834 Initial commit
$ git checkout f1edfaf
Note: checking out 'f1edfaf'.
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.
If you want to create a new branch to retain commits you create, 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 f1edfaf... initial commit
$ ls
index.html main.js README.md
$ git status
HEAD detached at f1edfaf
nothing to commit, working directory clean
$ git commit -m "reverted"
HEAD detached at f1edfaf
nothing to commit, working directory clean
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment