Resetting Coin count to start of Level on death

Hello, Currently I am having an issue with resetting the Coin Count on death. I have the script set up so the player will reset on death but when he runs into a coin instead of starting from 0 and counting up again it starts from the previous number he has died from for example if the player had 200 coins when he died he will end up with 210 when he picks up a 10g brick. My goal is to get the player to reset Coin count from where he started (the spawn point) at the beginning of the scene so if he had 200 Coins on level 2 but died with 250 coins it would be reset to 200 coins. I’ve looked around and honestly, have no idea where to start so anything would be helpful.

Thanks, everyone!

You need to store how much gold you had at the checkpoint.

        int curGold;
        int goldAtCheckPoint;

        void OnDeath()
            curGold = goldAtCheckPoint;

        void ReachedCheckpoint()
            goldAtCheckPoint = curGold;