I recently didn't get a part I really wanted and have been rethinking my career choice since then. I just don't feel the same excitement about dance anymore. I don't know how to get it back or if—it feels horrible saying this—I should just quit.
I have felt this way at times when casting didn't go my way. I remember being passed over for the role of Polyhymnia in Balanchine's Apollo—I complained endlessly about it to my friends and grew very discouraged. But I got through it, and I had opportunities to dance other wonderful parts after that. Try not to hinge your entire future on one role, or let this setback destroy your love for dance. Casting disappointments are part and parcel of a dance career, so it's important to learn how to compartmentalize your emotions and take things less personally.
It's possible that you aren't quite right for this particular part; lots of people want to dance Juliet or Kitri, for example, but not everyone can convincingly play a teenage ingénue or a sassy spitfire. (Sometimes casting is simply a matter of height or temperament, not talent!) Even if you are well-suited for the role, your director may not think you're technically or emotionally ready for it yet. But that doesn't mean there aren't other parts you'd be perfect in right now.
Try to channel your negative feelings into motivation. Set small goals during class to help rebuild your confidence. Show your director what you can do by immersing yourself in your current role, no matter how small you think it is. You could also ask to learn the part you were hoping for in the back of the room—it's hard to brood when you're too busy dancing. But most of all, keep pushing forward; there will be more performances and other opportunities. If you still feel no interest in dance as the year progresses, it may be time to reassess your career choice.