After you file

You must prepare the correct Form 1040NR.

Then attach that to Form 1040X, with explanation "Filed on the wrong form EZ instead of NR".