git reset
[git push](https://texonom.com/git-push-429b80e0274143799122b0534e0a2098) [git revert](https://texonom.com/git-revert-85f53ca4b5d04b8c958264ab028e13c9) 


## 브랜치가 가르키는 버전을 바꾼다
- remove 1 commit
```typegit reset --hard <sha1-commit-id>git push origin HEAD --force```


- make 3 commit to 1
```typegit reset --soft HEAD~3 &&git commit```

```typegit reset --hard ORIG_HEAD   //change branch referencexgit reset --merge ORIG_HEAD```
if argument is branch then refer reference of that branch (안연결될 놈들은 접근 못하기 때문에 삭제, 취소처럼 느껴지는거)


```typegit reset --soft HEAD~{{commit count}}ororgit reset --hard HEAD^git reset --hard master@{"10 minutes ago"}```
 
> —hard make all delete, —soft just move

- revert all
```typegit reset --hard HEAD```

### if already pushed
```typegit push origin HEAD --force```

> [Reset VS Checkout - GIT4 - Reset & Revert](https://opentutorials.org/module/4032/24532)

> [Delete commits from a branch in Git](https://stackoverflow.com/questions/1338728/delete-commits-from-a-branch-in-git)







