Rules for Rangers
The Beast Master Ranger (PHB, p. 93) requires the beast to die before get a new one, according to the rules.
If the beast dies, you can obtain another one by...
Rules for Revised Rangers
However, the Beast Conclave for the Unearthed Arcana Revised Ranger (play test material) class available on the DMs Guild seems to let you switch beasts by repeating the 8 hour ritual if you want.
With 8 hours of work and the expenditure of 50 gp worth of rare herbs and fine food, you call forth an animal from the wilderness to serve as your faithful companion.
This seems like it can be repeated at anytime, because they even make sure you don't have multiple pets.
... You can have only one animal companion at a time.
Given that the UA Revised Ranger can repeat the ritual for a different companion, indicates that at least that the designers don't think it would be over powered to allow the player to switch. That said, the options for companions in the Revised Ranger is a smaller list (though it containers a couple more powerful animals), so the balancing might be easier there.
Talk to your DM.