Trouble understanding a word group: Would that if I had!

Hi!

I dont understand the underlined collocation: "I didnt tell him, I`m afraid. Would that if I had!"

Thank you.

The expression I know is ‘Would that I had’, which means ‘I wish I had’ or ‘If only I had’.