In my experience, upper back pain is generally mechanical, i.e. it is not due to disc. It can be due to a sprained spinous ligament which has to be properly examined to say anything for sure. It could be muscular but those generally don't stay for so long.
Next Steps
you need sit straight, don't sit continuously for long, do some stretches. All these will help in muscle pain, but it would need a proper treatment if it is due to ligament.
Health Tips
Consult a pain clinic or orthopedics