So far, I have learned two ways to inverse a matrix, one way is through using the Gauss Jordan super augmented matrix which I can do fine, and the other way is using the "undo" of the elementary operation performed, which I am not 100% sure of because I might have copied my notes down wrong.
The example done in my notes was:
E = $ \left[ \begin{array}{cc} 1&2\\ 0&1\\ \end{array} \right]$
$R_1 \mapsto R_1 + 2R_2 $
Undo:
$R_1 \mapsto R_1 - 2R_2 $
$E^{-1}$ = $ \left[ \begin{array}{cc} 1&-2\\ 0&1\\ \end{array} \right]$
Main question is you use the undo operation on the identity matrix that corresponds to the matrix you're given right? Because if I were to perform the "undo" operation on the identity matrix I do get the inverse that my teacher wrote on the board. Would just like clarification on this. I am not sure if my conclusion is correct or only correct in this case.
If you perform steps $E_1,\dots ,E_n$ on a matrix $M$ and get the identity $I$, this essentially means $E_nE_{n-1}\dots E_2E_1M=I$.
Now you "undo" on identity matrix, so you get a new matrix $E_nE_{n-1}\dots E_2E_1I=E_nE_{n-1}\dots E_2E_1$
But we know that $(E_nE_{n-1}\dots E_2E_1)M=I$, then with the fact that in square matrices, if $AB=I$ then $BA=I$, we conclude that $M(E_nE_{n-1}\dots E_2E_1)=I$ and hence $M^{-1}=(E_nE_{n-1}\dots E_2E_1)$, your newly formed matrix by undo-ing.