Unix

GIT : 옛날에 지우고 커밋한 파일 살리기

ForceCore 2011. 8. 19. 21:06
http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo
매우 흥미롭군... 그냥, 작업하다 필요 없다고 생각해서 git rm을 했는데 나중에 다시 필요해지는 때가 있다... 물론 옛날때의 모습을 알아내는게 아니라 부활시켜야 하는 것임...

Find the last commit that affected the given path. As the file isn't in the HEAD commit, this commit must have deleted it.

git rev-list -n 1 HEAD -- <file_path>
Then checkout the version at the commit before.

git checkout <deleting_commit>^ -- <file_path>

이란다.