File tree Expand file tree Collapse file tree 5 files changed +33
-10
lines changed
Expand file tree Collapse file tree 5 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ Patches and Suggestions
168168- Nick Campbell
169169- Nick Payne
170170- Niklas Fiekas
171+ - Peter Bittner
171172- Prayag Verma
172173- R. Martinho Fernandes
173174- Raphael Fleischlin
Original file line number Diff line number Diff line change 2323 ;;
2424 --hard)
2525 test $2 -gt 1 > /dev/null 2>&1 && back=" ~$2 "
26- git reset --hard HEAD$back && exit 0 ;
26+ git reset --hard HEAD$back
2727 ;;
2828 -s|--soft)
2929 test $2 -gt 1 > /dev/null 2>&1 && back=" ~$2 "
30+ git reset --soft HEAD$back
3031 ;;
3132 * )
3233 test $1 -gt 1 > /dev/null 2>&1 && back=" ~$1 "
34+ git reset --soft HEAD$back
35+ git reset
3336 ;;
3437esac
35-
36- git reset --soft HEAD$back
37- git reset
Original file line number Diff line number Diff line change 11.\" generated with Ronn/v0.7.3
22.\" http://github.com/rtomayko/ronn/tree/0.7.3
33.
4- .TH "GIT\- UNDO" "1" "April 2018" "" "Git Extras"
4+ .TH "GIT\- UNDO" "1" "June 2018" "" "Git Extras"
55.
66.SH "NAME"
77\fB git \- undo \fR \- Remove latest commits
@@ -16,7 +16,7 @@ Removes the latest commits\.
1616\-\- soft or \- s
1717.
1818.P
19- This is the default, only rolls back the commit but changes remain un \- staged \.
19+ Rolls back the commit(s) but leaves the changes in the staging area \.
2020.
2121.P
2222\-\- hard or \- h
@@ -44,6 +44,19 @@ $ git undo
4444.IP " " 0
4545.
4646.P
47+ Removes the latest commit, restoring the staging area\.
48+ .
49+ .IP " " 4
50+ .
51+ .nf
52+
53+ $ git undo \- s
54+ .
55+ .fi
56+ .
57+ .IP " " 0
58+ .
59+ .P
4760Remove the latest 3 commits:
4861.
4962.IP " " 4
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ git-undo(1) -- Remove latest commits
1313
1414 --soft or -s
1515
16- This is the default, only rolls back the commit but changes remain un-staged .
16+ Rolls back the commit(s) but leaves the changes in the staging area .
1717
1818 --hard or -h
1919
@@ -30,6 +30,10 @@ git-undo(1) -- Remove latest commits
3030
3131 $ git undo
3232
33+ Removes the latest commit, restoring the staging area.
34+
35+ $ git undo -s
36+
3337 Remove the latest 3 commits:
3438
3539 $ git undo 3
You can’t perform that action at this time.
0 commit comments