github desktop) 실수로 stash overwrite를 눌렀을 때

2021. 5. 11. 21:41etc.

반응형

* 먼저 해당 문제가 발생하는 과정은..

1. yu branch로 작업1을 진행함

2. commit 을 하지 않은 상태로 master branch로 switch

3. 다시 yu branch로 변경. 작업1은 stashed changes로 들어간 상태임

4. 작업1을 restore하지 않은 상태로 작업2를 진행함

5. 작업2를 commit하지 않은 상태로 master branch로 swich

5를 하는 순간 경고창이 뜬다. 

6. 경고창에서 overwrite를 "실수로" 누름

7. master에서 yu branch로 switch 하면 stashed changes엔 작업2만이 존재함.. 

 

작업1은 찾을 수 없음.. 그냥 날아감..

 

 

하지만, 구글링 끝에 방법은 있었습니다. 모두 화이팅..!

 

1. github desktop 로그폴더 열기

 

2. 오늘 log파일을 열어줍니다.

3. stash로 검색해보면 stash의 id를 알수있습니다.

[ui] Dropped stash '9c2a7b7bd786b444f0692d8d699747079b' associated with yu

 

4. command를 켜주세요.

5. cmd 창에서 git 명령어 입력. 위에서 찾은 id를 입력해주면 됩니다.

git stash apply 9c2a7b7bd786b444f0692d8d699747079b

 

6. git desktop을 확인해보면 삭제됐던 stash가 돌아와 있습니다. - 끝 -

 

+) 4에서 만약 git을 따로 설치하라고 나오는데, 설치가 귀찮다면..? git desktop에 있는 git.exe를 사용.

 1. cmd 켜줍니다.

 2. cd 현재 작업중인 폴더

 3. 명령어 입력

    C:\Users\yu\AppData\local\GitHubDesktop\app-2.8.1\resorces\app\git\cmd\git.exe stash apply 9c2a7b7bd786b444f0692d8d699747079b

 

 

참고)

github.com/desktop/desktop/issues/10956

반응형