Prabir's Blog

where the tech matters...

Undo in Git

September 07
by prabir 7. September 2009 16:54

We are not perfect. There are may times when we make a mistake and need to revert back to the previous stage. Usually the most common way to do it would be by using Ctrl+Z.

How many times have you wanted to undo your commit? Did you ever make a spelling mistake? You did the wrong commit. If so here is the answer.

There are basically two ways to do it in Git. One is using soft reset and the other one using hard reset.

1. Soft Reset

This undo's your commit and keeps changes you have made in the working tree.

git reset --soft HEAD^

2. Hard Reset

This undo’s your commit and also resets your working tree to the last commit.

git reset --hard HEAD^

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags:

Git

Free private git hosting

August 30
by prabir 30. August 2009 22:36

Lately I have been a fan of git for making it as my default version control system. I have been learning it and also trying use it for my current projects.

There are quite a bunch of free git hosting around, but you basically have to open source your codes. So I searched around the net for some private hosting, which allows to hide the codes from public access. It might be helpful for you guys.

Here’s the list.

  1. http://gitfarm.appspot.com (thanks to Bo for telling)

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags:

Git