If you wish, you can get some more recent code from
https://github.com/frc1640. The past few repositories also have Java code for swerve if you are interested.
Using an absolute encoder will save a lot of trouble. You could try saving the value of the encoders to a file and use the last values to initialize the position the next time you power the robot on. However, if someone moves the pivots while the robot is off, it will cause problems. I would advise looking into adding an absolute encoder to your swerve for convenience.
~Laura