프론트엔드 첫걸음

git flow 사용하다가 실수로 finish 해버렷다면.... merge 취소하고 싶다면... 본문

개발 공부/Git

git flow 사용하다가 실수로 finish 해버렷다면.... merge 취소하고 싶다면...

차정 2023. 8. 4. 19:08

https://stackoverflow.com/questions/13450039/how-to-undo-git-flow-feature-finish

[How to undo git flow feature finish?

I am learning git-flow and I just did git flow feature finish , which merged my feature branch to develop and removed it. Instead of this, I want to push the feature branch to ...

stackoverflow.com](https://stackoverflow.com/questions/13450039/how-to-undo-git-flow-feature-finish)

git log

sha1 is the commit right before the merge (머지전의 develop 커밋)
sha2 is the last commit on develop before you started working on the feature (갈라졌던 커밋)

git checkout develop
git checkout -b feature/<feature-name>
git reset <sha1> --hard
git checkout develop
git reset <sha2> --hard

devolop에서  font-pertandard로 갈라져나가서 커밋 1개 feature finish했을때...
merge 직전의 커밋   da42a92 가 sha1
font-pretendard가 갈라져나왔던 e31d20e가 sha2