Permalink
Browse files

* Script to revert a single file (with git diff / patch)

  • Loading branch information...
1 parent 3d1bf98 commit f2ad0c4939a3e19f0c6ae098ac9006243d987355 @smtlaissezfaire committed Dec 25, 2008
Showing with 14 additions and 0 deletions.
  1. +14 −0 git-revert-single-file
View
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+function output_help {
+ echo "usage: git-revert-single-file <sha1> <file>"
+}
+
+sha1=$1
+file=$2
+
+if [[ $sha1 ]]; then
+ git diff $sha1..$sha1^ -- $file | patch -p1
+else
+ output_help
+fi

0 comments on commit f2ad0c4

Please sign in to comment.