If a cleric falls out of line from their Deity s/he becomes a ex-cleric and loses s/he powers but if said character started worshipping a Deity that is in their new allingment would s/he have to start over with a level one cleric or would s/he regain their powers. I ask because my caimpaign may require me to do what may be wrong in order to do what's right if that makes sense, I would end up doing evil to do good in the end, This is in 3.5 btw