Inflation generally doesn't hurt the value of stocks in a 401(k). You still own the same percentage of the underlying public corporations. Inflation only hurts your bond holdings. This is one reason why it's best to keep at least some of your retirement fund assets in stocks even as you approach retirement age rather than shifting entirely too bonds.
TIPS also provide a way to hedge against inflation in retirement funds.