notes
/
git reflog로 커밋 복구하기
Search
Share
⏱️
git reflog로 커밋 복구하기
실수로 커밋을 날려먹었을 때
git reflog
를 치면 지금까지 내가 git 에서 했던 모든 이력들을 확인할 수 있다
커밋 복구하기
# 커밋 제목을 기억하지 못하는 경우
git
reflog
# 복구하기!
git
reset
<
커밋해시
>
--hard
Bash
브랜치 복구하기
# 브앤치명 가져오기
git
reflog
|
grep
<
브랜치명
>
# 복구하기!
git
reset
<
커밋해시
>
--hard
Bash