If you haven't actually executed a command, you can just backspace and erase what you've typed, but if you've already executed it then you can do a Ctrl-C to stop it.
Ọ bụrụ na i mebeghị iwu, ị nwere ike ịnweta ndabere ma wepu ihe ị mebiri, ma ọ bụrụ na i mechaa ya, ị nwere ike ime Ctrl-C iji kwụsị ya.