working directory:
Staging area: 레포지토리 들어가기 전의 선택과정 , 커밋을 위한 준비단계
Repository: 깃 commit됨
파일을 그냥 삭제해본 뒤 git status로 살펴보기
파일의 삭제가 working directory에 있음
git reset --hard로 복원
git rm tigers.yaml로 삭제하고 git status로 살펴보기
파일의 삭제가 Staging area에 있음
git reset --hard로 복원
tigers.yaml를 zzamtigers.yaml로 이름변경 뒤 git status로 살펴보기
복원 후 git mv tigers.yaml zzamtigers.yaml로 실행 뒤 비교
(다음 커밋에 넣고싶은 수정파일이 있을때!)
git restore --staged 파일명
--staged를 빼면 working directory에서도 제거
예전: git reset HEAD (파일명)
git add한 파일 : panthers.yaml, tigers.yaml, pumas.yaml일때 pumas.yaml만 빼고싶은경우
reset의 세가지 옵션
--soft
: repository에서 staging area로 이동--hard
: 수정사항 완전히 삭제--mixed (default)
: repository에서 working directory로 이동