In 3e, there was the atonement spell, which would restore that and a couple of other things if you did the roleplaying to justify it.
5e has very few mechanics tied to alignment, and the only thing that I can think of which can cause it to change are in the DMG - the Deck of Many Things and some optional rules about planes.
atonement was the tool by which a fallen paladin could restore themselves, among other things - that would be handled quite differently in 5e.