File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 19
19
* [ Delete local branch] ( https://github.com/git-tips/tips#delete-local-branch )
20
20
* [ Delete remote branch] ( https://github.com/git-tips/tips#delete-remote-branch )
21
21
* [ 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 )
22
24
* [ Reword the previous commit message] ( https://github.com/git-tips/tips#reword-the-previous-commit-message )
23
25
* [ Changing a remote's URL] ( https://github.com/git-tips/tips#changing-a-remotes-url )
24
26
* [ 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>
134
136
git checkout -- < file_name>
135
137
```
136
138
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
+
137
149
## Reword the previous commit message
138
150
``` sh
139
151
git commit -v --amend
Original file line number Diff line number Diff line change 64
64
"title" : " Undo local changes with the last content in head" ,
65
65
"tip" : " git checkout -- <file_name>"
66
66
},
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
+ },
67
75
{
68
76
"title" : " Reword the previous commit message" ,
69
77
"tip" : " git commit -v --amend"
You can’t perform that action at this time.
0 commit comments