For matching payments, I don't think there's much you can do. I know for many companies the match starts out unvested - if you quit before you've worked there a certain number of years, you don't get any of the match (or perhaps a percentage of the full match based on how long you were there).
Similarly, for an ESPP (a program where you have money withheld from your paycheck, and every period (eg 3 months) you get to buy company stock at a discount), if you leave the company mid-period then you only get back your contribution - you don't still get the stock discount.