Skip to content

Instantly share code, notes, and snippets.

@ConradIrwin
Created August 15, 2011 08:27
Show Gist options
  • Select an option

  • Save ConradIrwin/1145899 to your computer and use it in GitHub Desktop.

Select an option

Save ConradIrwin/1145899 to your computer and use it in GitHub Desktop.
#!/bin/bash
if git rev-parse --verify "$1"
then
git reset HEAD^ --hard
git checkout "$1"
git cherry-pick "HEAD@{2}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment