0

I am currently trying to learn about git and have committed 2 changes to a project so far:

oshiro@debian:/var/www$ git log

commit 4fd249jf039jf49rj905482h794g805h4g53943h
Author: oshiro <oshiro@mail.com>
Date:   Wed Mar 12 15:07:00 2014 +0000

    removed junk from initial version

commit 39fru438439fj3498521490u53945u854u3084ut        
Author: oshiro <oshiro@mail.com>
Date:   Wed Mar 12 14:53:40 2014 +0000

    initial messy project version

oshiro@debian:/var/www$ 

Is it possible for me to switch between the initial messy project version and removed junk from initial version?

oshirowanen
  • 15,297
  • 82
  • 198
  • 350

2 Answers2

5

If you want to create a branch without the commit "removed junk from initial version", you can do

git checkout 39fru438439fj3498521490u53945u854u3084ut

And if you want to create a named branch out of this commit, you can do

git checkout -b new_branch 39fru438439fj3498521490u53945u854u3084ut
usha
  • 28,973
  • 5
  • 72
  • 93
3

Just checkout whichever commit you want.

git checkout 'commit'
Mason T.
  • 1,567
  • 1
  • 14
  • 33