# Undo after `git rebase`
```shell
git reset --hard ORIG_HEAD
```
# Undo after `git merge`
```shell
git reset --merge ORIG_HEAD
```
## Note: You can use `git reflog` and @ syntax also (google for more detail)
E.g. Reset to the 2 HEAD moves ago
```shell
git reflog
# The reflog will show here
```
Then you can use:
```shell
git reset --hard HEAD@{2}
```