본문 바로가기

GIT

conflict 후 되돌리고 싶을 때

 

git reflog

위 명령어로 head의 번호 확인

 

 

git reset --hard HEAD@{11}

11번으로 되돌린다

 

 

그 후에 status 확인 후 'git pull'

 

 

 

 

https://blankspace-dev.tistory.com/346

 

[GIT] git reset 또는 여러 명령어 취소하는 방법 (git reflog)

상황 [1] 오늘도 git에 코드를 업데이트하기 위해서 로컬에서 작업을 하고 있는데.. 로컬에만 commit을 해놓고, git push를 하지 않은 상태에서 reset으로 작업한 commit을 날릴 경우.. [2] 이전 커밋에서는

blankspace-dev.tistory.com

 

'GIT' 카테고리의 다른 글

커밋 메시지 수정  (0) 2023.11.03
error: The following untracked working tree files would be overwritten by merge:  (0) 2021.03.16
git stash  (0) 2021.03.10
GIT 명령어  (0) 2021.02.05