git add 시 파일 취소 방법

2021. 9. 10. 23:30꿀팁 분석 환경 설정/파이썬 개발 팁

728x90

git log 보기 (master) 보고 싶은 경우

git log --graph --decorate --oneline --all master

 

특정 파일 작업 취소하기 

최근 커밋으로 모든 내용 강제로 돌리고 싶은 경우

git reset --hard # 모든 파일의 작업 내용을 버림

특정 파일만 바꾸고 싶은 경우

git checkout -- [Filename] # 특정 파일의 작업 내용을 버림

특정 파일 add 취소 하고 싶은 경우

git reset HEAD [Filename] # 특정 파일을 Unstage 상태로 변경

 

728x90