A superconductor in a magnetic field acquires a finite electrical resistance caused by vortex motion. A quest to immobilize vortices and recover zero resistance at high fields made intense studies of vortex pinning one of the mainstreams of superconducting research. Yet, the decades of efforts resulted in a realization that even promising nanostructures, utilizing vortex matching, cannot withstand high vortex density at large magnetic fields. Here, we report a giant reentrance of vortex pinning induced by increasing magnetic field in a W-based nanowire and a TiN-perforated film densely populated with vortices. We find an extended range of zero resistance with vortex motion arrested by self-induced collective traps. The latter emerge due to order parameter suppression by vortices confined in narrow constrictions by surface superconductivity. Our findings show that geometric restrictions can radically change magnetic properties of superconductors and reverse detrimental effects of magnetic field.