2011-03-07 3 views

답변

42

대신 지점의 이름을 전달하는, 당신은 어떤 checkout에 ID를 저지 전달할 수 있습니다

git checkout <commit-id> 

See the man page합니다.

+0

아아아 : :) 체크 아웃은 브랜치 이름 만 허용한다고 생각했습니다. – xZise

+2

분기가 아닌 객체 (ID 또는 태그로 커밋)를 체크 아웃하면 분리 된 머리가 생깁니다. http://stackoverflow.com/questions/3965676 – Rudi

+2

최신 커밋으로 돌아가고 싶을 때 "git checkout nameOfYourBranch"를 사용하십시오. –

4

1 단계 :

[Comp:Folder User$ git log 
commit 54b11d42e12dc6e9f070a8b5095a4492216d5320 
Author: author <[email protected]> 
Date: Fri Jul 8 23:42:22 2016 +0300 

This is last commit message 

commit fd6cb176297acca4dbc69d15d6b7f78a2463482f 
Author: author <[email protected]> 
Date: Fri Jun 24 20:20:24 2016 +0300 

This is previous commit message 

commit ab0de062136da650ffc27cfb57febac8efb84b8d 
Author: author <[email protected]> 
Date: Thu Jun 23 00:41:55 2016 +0300 

This is previous previous commit message 
... 

2 단계 : 사본이 필요 해시를 커밋 붙여 당신이 예에서와 같이 목록을 얻을 것이다

git log 

: 커밋의 목록을 가져 오기 체크 아웃 :

git checkout fd6cb176297acca4dbc69d15d6b7f78a2463482f 

그 모두.

관련 문제