If I had known, I would have come (B1 Grammar)

To imagine the past being different (it didn't happen, and you can't change it now), use if + had + the past participle in the if half. This often carries regret or a gentle "if only".

Imagining a different past: if + had + past participle

The result: would have + past participle

The result half uses would have + the past participle. Both halves are about the past that didn't happen, so don't leave the have out.

Most regret is negative: hadn't / wouldn't have

Most third-conditional regret is about something that didn't happen. Make the if half negative with hadn't + the past participle, and the result negative with wouldn't have + the past participle. Either half (or both) can be negative.

Asking about a different past: What would you have done if …?

To ask about an imagined past, put would before the subject: would you have + the past participle. A question word like What / How can go first. The if half still uses had + the past participle.