git checkout -- <file>
git restore <file>
git reset --hard
checkout --·restore 는 파일을 인덱스 내용으로 되돌려서 add 해둔 변경은 남고, reset --hard 는 인덱스까지 HEAD 로 맞춘다.2
리모트 브랜치 가져오기
git remote update
리모트 전체를 fetch 한다.3
Footnotes
-
명령어로 discard를 하려면 ↩
-
git-restore: “By default, if
--stagedis given, the contents are restored fromHEAD, otherwise from the index.” / git-reset--hard— “Update the index to match the new HEAD, so nothing will be staged.” ↩ -
git-remote
update— “Fetch updates for remotes or remote groups in the repository as defined byremotes.<group>.” ↩