You loosen the cable by going to the caliper in picture 1. Depress the brake lever to create slack, (you can see the object of our desire, that little grey disk,) in picture 2. Turn the knurled knob that adjusts tension at the brake lever until the open channel in both parts lines up with the channel on the brake lever, (hard to see, but it's there,) in picture 3. Pull the cable through the channel so it is clear of the brake lever, then just pull out the cable end disk in picture 4.
Now, repeat the process on the other brake. Reverse the cables and reverse the order of dismantling to reassemble. You will have to reroute your cables at the head tube by opening the cable clips and changing out the cables from front to back, but, I feel, no pictures are required for that.
Lastly, a word of caution. It appears that there is an input from the left brake lever to the bicycle computer to tell the motor to turn off when you brake. That input is now switched from the back to the front brake. So, going forward, your motor will kick off only when you apply the front brake.