I'll echo pc88mxer. The better way is with branching and merging. The workflow goes like this:
- Create a branch off of trunk/master/production.
- Within that branch, make changes.
- Do commits to the branch at appropriate points. It doesn't have to be perfect because it doesn't affect anything in the main line.
- When it's back to working, merge the branch in with the other working code.
By the way, if you're looking for "the change that broke it", git-bisect is taylor made for that—if you're using git, of course.