So you are talking of a steep decent followed by a steep acent, like going down and up a mini-ravine or something to that nature?
A lot of riders will shift way down when approaching the decent, in anticipation for the climb on the other side. They loose momentum before they even hit the decent. Their momentum carries them halfway up the other side, and they madly spin their legs in 1st or 2nd gear, as their speed drops. Even when their speed slows down enough to match the gear they are in, the rider's body weight is totally incorrect for the climb, and they have to dab.
I would suggest staying in a larger gear. Accelerate before the decent in the big gear, rocket down the decent with an even pedal stroke, and fly back up the other side, combining your pedal stroke in a big gear with your momentum.
If you are talking about a smaller "pot hole", accelerate a ways before the hole, preload on the approach and then j-hop/bunny hop it.
Cheers,
Juba