Can I switch between GIT commits?

I am currently trying to learn about git and have made 2 changes to the 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 original dirty version of the project and remove the garbage from the initial version?

0


source to share


2 answers


If you want to create a noncommitting branch "deleted garbage from initial release", you can do

git checkout 39fru438439fj3498521490u53945u854u3084ut

      



And if you want to create a named branch from that commit, you can do

git checkout -b new_branch 39fru438439fj3498521490u53945u854u3084ut

      

+5


source


Just check which one you want.



git checkout 'commit'

      

+4


source







All Articles