git reset HEAD[file]
Staging Area에add한 파일들을 제거하고 싶을 때 사용한다.- 위 명령어를 통해
Staging area상태에 있는 파일을unstaged상태로 변경할 수 있다.- 파일명을 안 붙일 경우 전체 파일이
unstaged상태로 변경된다.
1)
commit을 취소하고staging area에 남길 때git reset --soft HEAD^2)
commit을 취소하고unstaged상태로 바꿀 때git reset --mixed HEAD^ : 기본옵션 git reset HEAD^ : 위와 동일 git reset HEAD~i : i개의 commit을 취소3)
commit을 취소하고unstaged상태로 변경 후 파일 삭제git reset --hard HEAD^
git reset --hard HEAD