Evolutionary rescue is the process by which a declining population successfully adapts genetically to avoid extinction. In a structured environment that deteriorates patch by patch, dispersal can substantially alter the chances of evolutionary rescue of a wild-type population not viable in deteriorated patches. Here, we investigate the effect of different dispersal schemes and intensities on the probability of successful establishment of a mutant population adapted to the deteriorated environment. We find that the probability of evolutionary rescue can undergo up to three phases when increasing the rate of dispersal: (i) at low dispersal rates, the probability of establishment of a mutant population increases; (ii) then at intermediate dispersal rates the establishment probability decreases; and (iii) at large dispersal rates, the population homogenizes, either promoting or suppressing the process of evolutionary rescue, depending on the fitness difference between the mutant and the wild type. Our results show that habitat choice, when compared to uniform dispersal, impedes successful adaptation when the mutant has the same habitat preference as the wild type, but promotes adaptation when the mutant mainly immigrates into patches where it has a growth advantage over the wild type.