Checkout [git add -p](http://johnkary.net/blog/git-add-p-the-most-powerful-git-feature-youre-not-using-yet/) which lets you commit only the code that you want to.