Dietary change can be a strong evolutionary force and lead to rapid adaptation in organisms. High-fat and high-sugar diets can challenge key metabolic pathways, negatively affecting other life-history traits and inducing pathologies such as obesity and diabetes. In this study we use experimental evolution to investigate the plastic and evolutionary responses to nutritionally unbalanced diets. We reared replicated lines of larvae of the housefly Musca domestica on a fat-enriched (FAT), a sugar-enriched (SUG), and a control (CTRL) diet for thirteen generations. We measured development time in each generation, and larval growth and fat accumulation in generation 1, 7, and 13. Subsequently all lines were reared for one generation on the control diet to detect any plastic and evolutionary changes. In the first generation, time to pupation decreased on a fat-rich diet and increased on a sugar-rich diet. The fat-rich diet increased fat accumulation and, to a lesser extent, dry weight of the larvae. Multigenerational exposure to the unbalanced diets caused compensatory changes in development time, dry weight, as well as absolute and relative fat content, although pattern and timing depended on diet and trait. When put back on a control diet, many of the changes induced by the unbalanced diets disappeared, indicating that diet has large plastic effects. Nevertheless, fat-evolved lines still grew significantly larger than the sugar-evolved lines, and sugar-evolved lines had consistently lower fat content. This can be an effect of parental diet or an evolutionary change in nutrient metabolism as a consequence of multigenerational exposure to unbalanced diets.