Arduino Can't Upload

I accidentally uploaded a program to my Leonardo that keeps typing random letters. I can't upload new code. How can I get rid of this code?