discard1

git checkout -- <file>

git restore <file>

git reset --hard

checkout --·restore 는 파일을 인덱스 내용으로 되돌려서 add 해둔 변경은 남고, reset --hard 는 인덱스까지 HEAD 로 맞춘다.2

리모트 브랜치 가져오기

git remote update

리모트 전체를 fetch 한다.3


Footnotes

  1. 명령어로 discard를 하려면 ↩

  2. git-restore: “By default, if --staged is given, the contents are restored from HEAD, otherwise from the index.” / git-reset --hard — “Update the index to match the new HEAD, so nothing will be staged.” ↩

  3. git-remote update — “Fetch updates for remotes or remote groups in the repository as defined by remotes.<group>.” ↩

`#105`