Different states have different laws, but many have faithless elector protections.
A faithless elector is someone who, after being chosen for the electoral college, does not vote for the candidate that everyone expected. Since states have a wide latitude to select or reject electoral college representatives, they can pas laws saying "If you change your vote, we will cancel your vote and replace you". I would expect that this popular vote compact requires such protection.