I'd retake some classes to get the GPA up, evne if you understand the topics depite the lower grade. Also, if you now understand the topics you got the lower greade in, maybe take some other electives that pertain to your major to get the gpa up, and just learn more. If you were to apply to graduate school mention that you now deeply understand the topics in the classes you scored low in, and you took some additional tech electives to get your overall GPA up and broaden your knowledge in your field. So, it might be a better idea to take new classes, opposed to retaking old classes if you now understand the topics in the old classes.
However, retaking classes you scored low in might help the gpa more than taking new classes and doing well in them, I dunno.