Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit f2ad0c4939a3e19f0c6ae098ac9006243d987355 1 parent 3d1bf98
@smtlaissezfaire authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 git-revert-single-file
View
14 git-revert-single-file
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.