Created
October 17, 2012 23:00
-
-
Save lionicsheriff/3908886 to your computer and use it in GitHub Desktop.
I should be more careful
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
function revert_last_commit() | |
{ | |
read -p "Are you sure you want to revert the last commit?[y/N] " -n 1 answer | |
echo | |
if test $answer = 'y' | |
then | |
svn up | |
local head="$(svn info | grep Revision | cut -d' ' -f2)" | |
local prev="$(expr $head - 1)" | |
svn merge -r $head:$prev . | |
svn commit -m "Revert last commit" | |
svn up | |
head="$(svn info | grep Revision | cut -d' ' -f2)" | |
prev="$(expr $head - 1)" | |
svn merge -r $head:$prev . | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment