프로젝트/협업|인프라
[Git] Git add, commit, push 취소
유(YOO)
2022. 12. 9. 23:16
add 취소
git status # 상태 확인
git reset HEAD # 전체 취소
git reset HEAD 파일이름 # 파일 취소
commit 취소
git log # Commit # 상태 확인
git reset --soft HEAD^ # commit 취소, add 취소X
git reset --mixed HEAD^ # commit 취소, add 취소, 작업내역 취소X
git reset HEAD~2 # commit 2개 취소, add 취소, 작업내역 취소X
git reset --hard HEAD^ # commit 취소, add 취소, 작업내역 취소
git commit --amend # commit 메세지 변경
push 취소
commit 취소 후, 강제로 원격 저장소에 덮어쓰는 방식이다.
git push origin -f
git push origin 브랜치이름 -f
git push origin +브랜치이름