Having

[Git] git rm --cached <파일명> 명령어로, stage에 등록된 파일을 working tree로 되돌리기 본문

Git

[Git] git rm --cached <파일명> 명령어로, stage에 등록된 파일을 working tree로 되돌리기

GHM 2022. 1. 23. 12:47

 

stage에 등록된 sample.txt 파일

 

 

 

 

 

staging된 파일을 다시 working tree(=working directory)로 되돌리기

: git rm --cached <파일명>
  - 로컬 저장소 파일만 삭제 (원격저장소 파일 그대로)

working tee로 돌아온 sample.txt 파일

커밋하려면, 다시 git add 후 커밋 실행해야한다.