A pt. operated for direct inguinal hernia developed anaesthesia at the root of the penis and adjacent part of the scrotum the nerve likely to be injured is -
All the three nerves ie genifotemoral, ilioinguinal & iliohypogastric are branches of the lumbar plexus and all may be injured in op. for hernia.

llioinguinal-Nerve 

enters the inguinal canal by piercing the internal oblique muscle (not through the deep ring)*
it then emerges from the superficial inguinal ring to supply the skin of
proximomedial skin of the thigh
the skin over the penile root.
the upper part of the scrotum

Iliohypogastric nerves

divides into two branches - lateral cutaneous and anterior cutaneous.
lateral cutaneous supplies - posterolateral gluteal skin
Anterior cutaneous supplies - suprapubic skin

Genitofemoral nerve 

divides into two branches
Genital and
Femoral

Genital or of Genitofemoral nerve - enters the inguinal canal at its deep ring and supplies

the Cremaster*
the scrotal skin*

Femoral or of genitofemoral nerve

passes behind the inguinal ligament, enters the femoral sheath lateral to femoral artery*, pierces the ant layer of the femoral sheath and fascia lata and supplies the skin anterior to the upper part of the femoral triangle.
Genital br. of genitofemoral nerve (supply dartos muscle)
Femoral br. of genitofemoral nerve
Iliohypogastric nerve
Ilioinguinal nerve