Selling your military time back

Anyone out there prior military who separated but ended up with a government job and sold their time back to retire? How did the process work and was it worth it?