For waypointV2Mission, you can pasue the mission and fly back. After hot-swaping batteries, you can resume the mission and the aircraft will continue executing the mission.
For waypointMission, MSDK does not support this feature. Therefore, you have to write your own logic to achieve this goal. A possible solution is recording the reached waypoints. When you change the batteries, you need to re-upload and start the mission again. Remember to eliminate the reached waypoints fom your original waypointMission and execute a new mission.