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 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>
134136git 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
139151git commit -v --amend
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments