I think the biggest problem low time pilots have with bumpy fields is the fact that the bumps tend to bounce the aircraft into the air before it is quite ready to fly. Whe this happens the tendency is to pull back creating an excessive angle of attack which causes the aircraft to stop accelerating and in extreme cases staggering into the air and then stalling.
As Pilot DAR pointed out establish the attitude that just flies the nose wheel off the ground and
hold that. If the airplane bounces into the air hold the attitude if it is ready to fly it will stay in the air, if not it will settle back on the ground and continue accelerating until it is ready to fly.
As for the flaps issue. Well the POH for every model of C 172 says use 10 degs for soft/rough fields. It doesn't say mess with them on the takeoff run.
Your attention is IMHO far better used concentrating holding the takeoff run attitude. Also the POH (the book that nobody in the UK flight training scene ever seems to look at
) for the C172M says the target speed for a short field takeoff is 59 kts at 50 feet AGL.
That is the number you should look for
after the aircraft has broken ground and started climbing away.