You can recover your points and rebuild your mastery tree as many times as you like, as long as you have the correct amount of Units. Once you have unlocked a mastery, it will remain unlocked, and you will not need to use class-specific, Carbonadium, or Stony Mastery Cores to unlock them again. However, recovering mastery points will NOT refund the Gold or Units that you spent to level up each rank.
This means that any class-specific, Carbonadium, or Stony Mastery Cores that were purchased to unlock mastery nodes will not need to be purchased again.