git reset HEAD^
git commit -m "1"
git commit -m "2"
git commit -m "3"git reset --hard [1번commit hash]
git push
- 2,3번 커밋 반영 내용이 사라진다.
git commit -m "1"
git commit -m "2"
git commit -m "3"git reset --mixed [1번commit hash]
git add .
git commit -m "~"
git push
- 이력은 날아가나 unStage 상태로 코드는 남아있다.코드를 반영하기 위해서는 add이후 stage에 반영하고 commit한다.
git commit -m "1"
git commit -m "2"
git commit -m "3"git reset --soft [1번commit hash]
git commit -m "~"
git push
- add 명령어 필요없이 바로 commit이 가능하다.