회사에서 PR을 열었다가, 오류를 발견하고 PR을 닫았다.

내 branch에 올라간 commit을 revert 하는 방법은 다음과 같다.

 

로컬 

git reset --hard HEAD~1

로컬 commit이 이전 log로 돌아간다.

 

리모트

git push -f origin harry-l

리모트 브랜치인 harry-l의 커밋 상태가 취소 된다.

 

Reference

+ Recent posts