My personal preference is that after fairly brief refit, command of the Enterprise was turned over to Will Decker and he took her out again. Years and many missions later, Decker brought the Enterprise back to Earth (by this time Kirk is already CoSO) and the rebuild process began.
Two things from TMP work against this, however.
First, when Scotty is speaking to Kirk in the travel pod, he refers to Decker as an "untried captain," which certainly wouldn't be true if Decker had been out there commanding the Enterprise
for a number of years.
Second, when Kirk is explaining to Decker why he is taking command, he cites his experience of "five years out there dealing with unknowns like this." If Decker had also been out there for several years, Kirk's experience wouldn't be a factor.