Psalms 51:12 “Restore unto me the joy of thy salvation; and uphold me with thy free spirit.”
Please note this is verse #12 of this psalm which began by stating that David had written this psalm after his sin with Bathsheba had been exposed by Nathan the prophet. The first 11 verses David spent confessing his sin to God and asking God to purge him (v7), restore his ability to hear God speaking (v8), to forgive his sin (v9), and to create or fashion a clean heart in him.
In verse 12 though David asks God to restore the joy of God’s salvation unto him. That word “restore” means to turn back, to bring back, or reverse to a former state.
He didn’t need to be saved all over again, getting salvation once is more than enough. What David did need is to get the joy of that salvation back. Living in sin steals your joy not your salvation. While in sin we may be successful in covering our feelings with the sin we are in but that is all we are doing. The longer we remain in sin the more we will find that we need of that sin to mask our sorrow. All in an effort to numb the pain in our heart from the damage done to the joy that once was there.
David didn’t write this psalm immediately after his affair. This took months, her husband was murdered, David married her to make it all legit, and the child was born. Given how the baby isn’t named in scripture most likely it was within a couple of days of the birth that Nathan confronted David and around the time of the child dying that the psalm was penned. It is best to seek God’s forgiveness as soon as possible but this psalm does show that God cam still forgive even if we choose to live with the sin for a while (I do not encourage this at all).
Confession of sin clears the way for the joy to be restored. Like cleaning off all the dirt before the real work can begin on the restoration project. The good news is that like a true craftsman when God restores that joy you can’t see any difference, it looks brand new (because it is!).