I pulled a muscle in my upper back how do I get rid of it?

Ice. Apply an ice pack for 20 minutes. If you can take an over the counter anti-inflammatory medication, that would help also. As you improve, gradually stretch your back muscles to restore range of motion.