F1 international student, filled forms in TurboTax, and get refund. However I was told I should have filled Form 1040NR, not Form 1040. How can I return the money to IRS?

I am F1 international student, non-residents.

I filled tax forms in TurboTax, and get refund now. 

However I was told that I should have filled Form 1040NR-EZ, not Form 1040. 

I have filled Form 1040X and 1040NR-EZ to amend it, yet how can I return the money to IRS?