This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |