Nest all content into snippets
This commit is contained in:
21
snippets/git/s/undo-commit.md
Normal file
21
snippets/git/s/undo-commit.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Undo a commit
|
||||
type: snippet
|
||||
language: git
|
||||
tags: [commit,branch]
|
||||
cover: mask-quiet
|
||||
dateModified: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Undoes a specified commit without rewriting history.
|
||||
|
||||
- Use `git revert <commit>` to revert the specified `<commit>`, creating a new commit with the inverse of the commit's changes.
|
||||
|
||||
```shell
|
||||
git revert <commit>
|
||||
```
|
||||
|
||||
```shell
|
||||
git revert 3050fc0d3
|
||||
# Reverts the commit `3050fc0d3`
|
||||
```
|
||||
Reference in New Issue
Block a user