If you've cut through the cable fairly close to the machine, and don't mind it being a little shorter than before. Cut the cable a few inches before the damage and strip back the outer sheath and expose the inner wires, then strip back each of those by 10mm to expose the conductors.
Then locate all the screws on the body of the tool that hold the plastic shell together, remove these and open up the shell of the trimmer at the cable input end, and you will see how the original cable was connected, and swap with the new end you've just made. Then put back together and you'll be up and running again. Will take less than 10 minutes to do.
Rupert, June 2020