Permalink
Browse files

Added git-undo for removing recent commits.

  • Loading branch information...
1 parent 27e0d0e commit 22ac3672848b522ad3b40894e1725b161870401f @kennethreitz kennethreitz committed with Tj Holowaychuk Aug 28, 2010
Showing with 24 additions and 1 deletion.
  1. +2 −1 Makefile
  2. +11 −0 Readme.md
  3. +11 −0 bin/git-undo
View
@@ -14,7 +14,8 @@ BINS = \
git-contrib \
git-update-extras \
git-extras-version \
- git-release
+ git-release \
+ git-undo
install:
@echo "... installing to $(PREFIX)/bin"
View
@@ -207,6 +207,17 @@ Listing commits:
* Added --all support to git-count
* Initial commit
+## git-undo
+
+Removes the latest commit
+
+ git undo
+
+Remove the latest 3 commits:
+
+ git undo 3
+
+
## git-update-extras
Updates git extras. clones the repo to _/tmp/git-extras_, make installs, then cds back to the origin directory.
View
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if test $# -eq 0; then
+ git reset --hard HEAD~1
+else
+ if `echo $1 | grep -q [^[:digit:]]`; then
+ echo $1 is not a number
+ else
+ git reset --hard HEAD~$1
+ fi
+fi

0 comments on commit 22ac367

Please sign in to comment.