The production invested in wonders, in case AI beats you to them, is lost, however, you get compensation in gold. With other things your progress is saved for 10 turns, after that point you start losing some hammers, but not much.
Something I've noticed recently: a unit production stopped due to losing strategic resource and the progress wasn't saved. When I got the resource back, only couple of turns later, I had to start building it from scratch. I can be wrong here, though, I wasn't paying too much attention, since it was negligible and lots of other things were going on. But I think that's what happened. Can anyone confirm/refute?