Using your version control system, go back in time until just before the bug appeared and diff that code against the first revision where the bug is introduced.
Use a binary search tree approach to make the process faster.
I'm told there's a git command or tool that makes this easy.