Last active
October 31, 2019 15:36
-
-
Save t3hnar/377684153edb6aa6bacbbff1a23abefc to your computer and use it in GitHub Desktop.
revert-to.sh
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
REVISION=$1 && | |
BRANCH=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') && | |
git reset --hard $REVISION && | |
MSG="revert $BRANCH to ${REVISION}" && | |
git merge -s ours @{1} -m "${MSG}" && | |
echo $MSG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example: