Controlling the anomalous Hall effect (AHE) inspires potential applications of quantum materials in the next generation of electronics. The recently discovered quasi-2D kagome superconductor CsV3Sb5 exhibits large AHE accompanying with the charge-density-wave (CDW) order which provides us an ideal platform to study the interplay among nontrivial band topology, CDW, and unconventional superconductivity. Here, we systematically investigated the pressure effect of the AHE in CsV3Sb5. Our high-pressure transport measurements confirm the concurrence of AHE and CDW in the compressed CsV3Sb5. Remarkably, distinct from the negative AHE at ambient pressure, a positive anomalous Hall resistivity sets in below 35 K with pressure around 0.75 GPa, which can be attributed to the Fermi surface reconstruction and/or Fermi energy shift in the new CDW phase under pressure. Our work indicates that the anomalous Hall effect in CsV3Sb5 is tunable and highly related to the band structure.