Your toe can be forced out of its normal position (dislocated) if you jam it or bend it too far backward (hyperextend). Toe dislocations are common, especially during sports. You probably knew right away that something was wrong, because your toe hurt a lot, swelled, and looked crooked. The doctor put your toe back in its normal position. But you will still need to be careful, because it can more easily go out of position again.
Rest and home treatment can help you heal. Your doctor probably taped the injured toe to the one next to it or put a splint on your toe to keep it in position while it heals. The doctor may recommend exercises to strengthen your toe. If you damaged bones or muscles, you may need more treatment.