잊어먹을까봐 저장하는 놈들/version control
svn revert ---> git revert ???
muninn
2009. 5. 7. 11:04
local 수정 파일에 대해서 다시 원복하는 경우 svn은 다음과 같다.
svn revert
git의 경우는 어떻게 하나? git에서는 두 단계를 거쳐야 한다.
git reset HEAD file
git checkout file
rm/modiied 된 file들에 대해서는 위와 같이 수행하면 되고, mv를 실행한 경우는?
git mv file1 file2
-- 원복 --
git reset file2
git reset HEAD file1
git checkout file1
rm file2
단 이경우 file의 부분에 대한 arg 값을 wildcard를 쓰는 경우 전체 repo에 적용되기도 하므로 specific하게 지정해야 한다.
svn revert
git의 경우는 어떻게 하나? git에서는 두 단계를 거쳐야 한다.
git reset HEAD file
git checkout file
rm/modiied 된 file들에 대해서는 위와 같이 수행하면 되고, mv를 실행한 경우는?
git mv file1 file2
-- 원복 --
git reset file2
git reset HEAD file1
git checkout file1
rm file2
단 이경우 file의 부분에 대한 arg 값을 wildcard를 쓰는 경우 전체 repo에 적용되기도 하므로 specific하게 지정해야 한다.