git
git 기본 터미널 명령어
yulme
2020. 4. 20. 19:02
SMALL
1. 파일 수정 후 다른 점 보기
: git diff
2. 파일 수정 전으로 되돌리기
2-1. staging 하기 전에만 사용가능
: git checkout -- 파일이름.txt
2-2. staging 되돌리기 (commit 전)
: git reset HEAD 파일이름.txt
2-3. commit 되돌리기
: git reset HEAD^
2-4. 그외
- git reset --soft HEAD^
: commit 취소
- git reset --mixed HEAD^
: commit, staging 둘다 취소
- git reset --hard HEAD^
: commit, stagint, 수정 다 취소
2-5. 특정 commit이 최근 commit이 되게 하기
: git log -> 최근 commit 되게 하고 싶은 commit의 해시(commit 고유 번호) 복사. -> git reset --hard 복사한hash주소
2-6. 최근 commit 재설정 시 commit들 안 지우고 재설정
: git revert 커밋해시
반응형