Skip to content

Instantly share code, notes, and snippets.

View bsandrow's full-sized avatar
🤖
This is a test of the emoji broadcast system. This is only a test.

Brandy Sandrowicz bsandrow

🤖
This is a test of the emoji broadcast system. This is only a test.
View GitHub Profile
@wolever
wolever / git-unpull
Last active December 21, 2015 04:08
git-unpull: undoes the merge commit created by an accidental 'git pull', plus some added helpful information!
#!/bin/bash
# Reverts HEAD back to ORIG_HEAD, for example after a 'git pull' accidentally
# creates a merge. This is identical to running 'git reset --hard ORIG_HEAD',
# except that unpull prints some helpful information along the way.
# Useage:
# $ git unpull
# HEAD: a0ac0fd Merge branch 'master' of /tmp/foo
# 2284c9d some remote commit
# ORIG_HEAD: 35431fd my local commit
# Really reset HEAD to ORIG_HEAD? (y/n) y