DevOps/Git
git reflog
iliosncelini
2019. 7. 24. 18:09
1. git reflog
git rebase또는git reset등으로 커밋이 삭제될 수 있다.- 하지만, git 이력은 보관되고 있는데 이러한 이력을 볼 수 있는 명령어가
git reflog
2. commit 복구하기
git reflog명령어로 삭제된 commit id 확인 후git reset --hard <커밋해시id>
3. branch 복구하기
git reflog또는git reflog |grep 브랜치명으로 log확인git checkout -b <삭제한 브랜치명> <커밋해시id>
