How are contracts governed?

How are contracts governed? For example, if there is a bug in the contract that has been run, how to fix it?

The developer of that contract will have to think about that from the start e.g. provide a way for the user to migrate the data/funds to a fixed version of that contract.