You're on 'base' to a suitable field, select 2 stages flap. Turn 'final' towards the field and realise you're not quite going to make it because the wind is more than you allowed for. Sure, I'd remove the flap again.
And yes, I'd adjust the pitch as required to make sure I maintained a safe airspeed (that's a no-brainer isn't it?).
The main point is you'll always be lower now than had you not taken flap in the first place, but clean you'll now glide further because the drag is less.
If you're at 100 feet when you realise you're not going to make the field, you're screwed anyway. Just hope you picked a field with an alternative in the undershoot. Which of course you did, didn't you.....