local/pushed commit 수정/삭제 방법 (reset/rebase/revert/checkout)
·
Coding/Github & Git
local 상태git log # commit 기록 확인 -> q로 나가기git reset HEAD^ # 직전 commit 기록 삭제git reset HEAD~[번호] # n번째 이전 commit 기록 삭제, 'HEAD~[번호]' 대신 주소(앞 7자리) 입력시 해당 커밋git commit --amend # 직전 commit 메시지 수정 -> 텍스트 편집기에서 수정 후 저장git rebase -i HEAD~[번호] # n번째 이전 commit 기록 출력, 'HEAD~[번호]' 대신 주소(앞 7자리) 입력시 해당 커밋# 수정하고자 하는 commit의 'pick'을 'reword'로 변경 후 저장 -> :wq!로 나가기# commit 메시지 수정 후 저장 -> :wq!로 나가기 pushed 상태# local과 ..