checkout: Switch branches or restore working tree files
아래와 같이 분리!
switch: Switch branches
restore: Restore working tree files
git switch {branch name} : {branch name} 브랜치로 변경!git switch -c {branch name} :{branch name}의 브랜치를 생성 + 그 브랜치로 이동!restore는 워킹 트리의 파일을 복원해 주는 역할을 한다.
- README 파일을 수정했는데 이를 다시 복구하고싶다!
git restore REAME.md로 복구
git add를 통해 스테이지에 넣었는데 이걸 다시 빼고 싶다.
git restore --staged README.md로 빼자
(이전에는git reset HEAD README.md처럼 했어야했는데)