git 복구

codelab·2022년 10월 26일
0

git

목록 보기
2/5

restore

파일을 최근 또는 특정시점 커밋상태로 원복

git restore 복구할파일명
git restore --source 커밋아이디 복구할파일명

파일 staging(git add) 취소

git restore --staged 파일명

revert

특점 커밋(또는 방금 생성한 커밋)에 변경을 취소하는 커밋이 생성됨

git revert 커밋아이디
git revert HEAD

reset

git reset --hard (커밋아이디) // 걍 커밋시점으로 다 리셋(변동사항 지우기)
git reset --soft (커밋아이디) // 리셋인데 변동사항 지우지 말고 스테이징 해놓기
git reset --mixed (커밋아이디) // 리셋인데 변동사항 지우지 말고 unstage 해놓기

push 취소

참고

https://ninano1109.tistory.com/3

profile
즐거운 개발자

0개의 댓글