This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-11-13 17:27:49

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Restore changeset in a Git repo

How should I restore a past changeset in a Git repository?


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2 2012-11-13 17:40:43

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Restore changeset in a Git repo

Um... I don't really get what you want. Do you want to go back to a certain revision?


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#3 2012-11-13 17:41:51

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Restore changeset in a Git repo

MathWizz wrote:

Um... I don't really get what you want. Do you want to go back to a certain revision?

Yeah.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#4 2012-11-13 17:49:16

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Restore changeset in a Git repo

Use

Code:

$ git log

to find the revision you want, then take the hash (you only need the first 7 letters of it) and run

Code:

$ git checkout cb2179f // random fake hash

or you can go back a specific number of commits:

Code:

$ git checkout HEAD~3 // go back 3 commits

to go back to the latest commit (the head):

Code:

$ git checkout master

Last edited by MathWizz (2012-11-13 17:49:43)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#5 2012-11-13 17:56:05

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Restore changeset in a Git repo

MathWizz wrote:

Use

Code:

$ git log

to find the revision you want, then take the hash (you only need the first 7 letters of it) and run

Code:

$ git checkout cb2179f // random fake hash

or you can go back a specific number of commits:

Code:

$ git checkout HEAD~3 // go back 3 commits

to go back to the latest commit (the head):

Code:

$ git checkout master

Thanks.  smile


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

Board footer