I just got my upper ear pierced, I took the earring out accidently, now its swollen, what can I do for it?

Possible infection. Recent ear piercings are at high risk for infections and hematomas (bleeding under the skin), both of which can cause swelling. See your family doctor or ear, nose and throat doctor for an evaluation.
Clean with alcohol. Clean the area with alcohol or hydrogen peroxide and then put a warm compress on the area for five minutes. The apply Neosporin ointment. Do this three times a day. If it is getting worse see your doctor. You may an oral antibiotic.