You will want to use the git revert command. This will allow you to change to a past commit, then commit that code so that it only appears as a hiccup on your timeline. There is a good article here that explains how to use git revert just as I described. You will want to get the hash of the code commit, you should be able to see this in GitHub.com.