mirror of
https://github.com/cupcakearmy/memoir.git
synced 2025-09-05 15:30:41 +00:00
add revert commit
This commit is contained in:
16
pages/git/revert-commit.md
Normal file
16
pages/git/revert-commit.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Revert branch to commit
|
||||
|
||||
Revert a branch to a certain commit, discarding newer ones.
|
||||
|
||||
```bash
|
||||
# Specific commit
|
||||
git reset --hard a1d6424
|
||||
|
||||
# Commits back
|
||||
git reset --hard HEAD@{3}
|
||||
```
|
||||
|
||||
```bash
|
||||
# Push
|
||||
git push -f
|
||||
```
|
Reference in New Issue
Block a user