Firebird News

Monday, December 13, 2010

How can i revert to previous version in git ?

There is git revert HEAD  and here is how i tested on a simple repository
mkdir test
cd test
git init  .
touch to_be_reverted
git add .
git commit -a
echo "Wrong text" > to_be_reverted
check it with

cat to_be_reverted
Wrong text
git commit -a
git revert HEAD
cat to_be_reverted

it should be empty like before

No comments: