This is a Bad Commit I will Roll Back

How do you choose not to commit something you know is bad? Can I go back
to the previous version somehow?