Skip to content

Commit 4cdc87f

Browse files
committed
Using revert and reset
1 parent de65ecb commit 4cdc87f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* [Delete local branch](https://github.com/git-tips/tips#delete-local-branch)
2020
* [Delete remote branch](https://github.com/git-tips/tips#delete-remote-branch)
2121
* [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head)
22+
* [Revert: Undo a commit by creating a new commit](https://github.com/git-tips/tips#revert-undo-a-commit-by-creating-a-new-commit)
23+
* [Resert: Discard commits, advised for private branch](https://github.com/git-tips/tips#resert-discard-commits-advised-for-private-branch)
2224
* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message)
2325
* [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url)
2426
* [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references)
@@ -134,6 +136,16 @@ git push origin :<remote_branchname>
134136
git checkout -- <file_name>
135137
```
136138

139+
## Revert: Undo a commit by creating a new commit
140+
```sh
141+
git revert <commit-ish>
142+
```
143+
144+
## Resert: Discard commits, advised for private branch
145+
```sh
146+
git reset <commit-ish>
147+
```
148+
137149
## Reword the previous commit message
138150
```sh
139151
git commit -v --amend

tips.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
"title": "Undo local changes with the last content in head",
6565
"tip": "git checkout -- <file_name>"
6666
},
67+
{
68+
"title":"Revert: Undo a commit by creating a new commit",
69+
"tip":"git revert <commit-ish>"
70+
},
71+
{
72+
"title":"Resert: Discard commits, advised for private branch",
73+
"tip":"git reset <commit-ish>"
74+
},
6775
{
6876
"title": "Reword the previous commit message",
6977
"tip": "git commit -v --amend"

0 commit comments

Comments
 (0)