[git] git reset에 대한 나름의 이해

2023. 10. 20. 14:53git

git reset은 hard, mixed, soft가 있다.

 

처음 상태

hard의 경우 commit 기록을 이전으로 돌리고 현재 파일도 커밋 이전으로 돌린다.

mixed의 경우 아직 commit기록을 commit하기 전으로 돌리되 현재 파일은 커밋 이후와 같다. 그리고 스테이징이 되지 않은 상태이다. 

soft의 경우 commit 기록을 이전으로 돌리되 현재 파일은 커밋 이후와 같다. mixed와의 차이는 스테이징이 된 상태이다.

 

Reference


https://da-nyee.github.io/posts/git-git-reset-git-reflog/

 

[Git] git reset –hard 되돌리기 (feat. git reflog)

Introduction

da-nyee.github.io

https://git-scm.com/book/ko/v2/Git-%EB%8F%84%EA%B5%AC-Reset-%EB%AA%85%ED%99%95%ED%9E%88-%EC%95%8C%EA%B3%A0-%EA%B0%80%EA%B8%B0