본문 바로가기
Github

git revert, rest, restore

by anion 2023. 8. 2.

파일 복구하는 법

git restore 파일명

 

특정 commit 시점으로 파일 복구하는 법

git restore --source 커밋아이디 파일명

 

스테이징 취소 가능

git restore --staged 파일명

 

commit 취소하는 법

git revert 커밋아이디

최근 commit 취소가능

git revert HEAD

 

과거로 모든걸 되돌리기

git reset --hard 커밋아이디

(협업시 사용금지)

 

리셋인데 변동사항 지우지말고 스테이징해두기

git reset --soft 커밋아이디

리셋인데 변동사항 지우지말고 unstage해두기

git reset --mixed 커밋아이디

'Github' 카테고리의 다른 글

타인과 협업하기(git clone, pull)  (0) 2023.08.02
Github 사용법 (git push)  (0) 2023.08.02
git branch  (0) 2023.08.02
git add, commit  (0) 2023.08.02