If you mistakenly filed a Form 1040, 1040A or 1040EZ and you need to file 1040NR or 1040NR-EZ, or vice versa, you will need to amend your return.
Per the IRS Instructions for Form 1040X Amended U.S. Individual Income Tax Return, page 5:
Resident and nonresident aliens. Use Form 1040X to amend Form 1040NR or Form 1040NR-EZ. Also, use Form 1040X if you should have filed Form 1040, 1040A, or 1040EZ instead of Form 1040NR or 1040NR-EZ, or vice versa.
To amend Form 1040NR or 1040NR-EZ, or to file the correct return, do the following:
Per IRS Publication 519 U.S. Tax Guide for Aliens, page 36:
Amended Returns and Claims for Refund
If you find changes in your income, deductions, or credits after you mail your return, file Form 1040X, Amended U.S. Individual Income Tax Return. Also use Form 1040X if you should have filed Form 1040, 1040A, or 1040EZ instead of Form 1040NR or 1040NR-EZ, or vice versa. If you amend Form 1040NR or Form 1040NR-EZ or file the correct return, attach the corrected return (Form 1040, Form 1040NR, etc.) to Form 1040X. Print “Amended” across the top. Ordinarily, an amended return claiming a refund must be filed within 3 years from the date your return was filed or within 2 years from the time the tax was paid, whichever is later. A return filed before the final due date is considered to have been filed on the due date.