I know that to reverse a Euler rotation you have to invert the rotation order and then rotate by the negative amount of rotation in each axis.
So if I have a vector v=$\begin{pmatrix} v_1\\v_2\\v_3 \end{pmatrix}$ which I first rotate by $r_1$ around the x-axis then by $r_2$ around the y-axis then $r_3$ around the z-axis. To get my original vector v again I have to first rotate by $-r_3$ around the z-axis then by $-r_2$ around the y-axis then $-r_1$ around the x-axis.
However the program I am using doesn't allow me to change the Euler rotation order and always uses XYZ Euler rotation, so given vector v' which is the vector v that has already been rotated, and the XYZ Euler rotation angles ($r_1$,$r_2$,$r_3$) by which v was rotated, how do I get the XYZ Euler rotation angles to rotate v' back to v?