The command to force restoration of all missing thumbnails and optimized image sizes for posts, avatars, etc is:
rake uploads:regenerate_missing_optimized
If you have a lot of images this may take a very long time. On a 4 CPU system with 8GB it took 32 hours to regenerate all images for a forum with 29GB of original uploads.