We can use the lens formula to find the focal length of the lens:
\[
\frac{1}{f} = \frac{1}{v} - \frac{1}{u}
\]
where \( u = -20 \, \text{cm} \) (object distance), \( v = 50 \, \text{cm} \) (image distance).
Substituting the values into the lens formula:
\[
\frac{1}{f} = \frac{1}{50} - \frac{1}{-20} = \frac{1}{50} + \frac{1}{20} = \frac{2 + 5}{100} = \frac{7}{100}
\]
Thus:
\[
f = \frac{100}{7} = 12 \, \text{cm}
\]
The focal length of the lens is \( 12 \, \text{cm} \).