8-2. 커밋하지 않은 변경사항 되돌리기

이경영·2022년 10월 3일
0

Git&Github

목록 보기
10/17

git restore

: checkout으로 사용되던것이 switch와 restore로 분리되어 나옴

  • 파일 여러개를 수정하고 명령어 사용
    git restore (파일명)

실습

git add 되지 않은 상태 -> 이전 상태로 바꾸기

  • jaguars.yaml파일과 leopards.yaml파일 수정하기
  • leopards.yaml 되돌리기와 전체 수정파일 되돌리기


git add 된 상태에서 내리기

git restore --staged (파일명)


원하는 커밋 위치로 내리기

git restore --source=커밋해시 파일이름(ex.tigers.yaml)

: 파일의 커밋이 변한게 아니라 파일만 변함


profile
꾸준히

0개의 댓글