Your rights, and the company's rights, will depend on the law where you areand they are located, and on the exact wording of the contract. If you were in fact paid more than your previous contract says that you were entitled to, you might well be required to repay it, but we can't be sure, nor do we know what mechanism can be used for such repayment.
You are going to need to talk to your company, and probably to a local employment lawyer to whom you can give the full detailed facts.