We perform Brownian dynamics simulations of active stiff polymers undergoing run-reverse dynamics, and so mimic bacterial swimming, in porous media. In accord with recent experiments of emph{Escherichia coli}, the polymer dynamics are characterized by trapping phases interrupted by directed hopping motion through the pores. We find that the effective translational diffusivities of run-reverse agents can be enhanced up to two orders in magnitude, compared to their non-reversing counterparts, and exhibit a non-monotonic behavior as a function of the reversal rate, which we rationalize using a coarse-grained model. Furthermore, we discover a geometric criterion for the optimal spreading, which emerges when their run lengths are comparable to the longest straight path available in the porous medium. More significantly, our criterion unifies results for porous media with disparate pore sizes and shapes and thus provides a fundamental principle for optimal transport of microorganisms and cargo-carriers in densely-packed biological and environmental settings.