Whoever takes an oath to do something and then he finds a better alternative which brings him closer to Allah should do what is better in piety. [Muslim]
"عن أبي طَرِيف عدي بن حاتم -رضي الله عنه- مرفوعاً: «مَن حَلَف على يَمِين ثم رأى أَتقَى لله مِنها فَلْيَأت التَّقوَى». [صحيح.] - [رواه مسلم.]"