For a fixed graph H, we consider the H-Recoloring problem : given a graph G and two H-colorings of G, i.e., homomorphisms from G to H, can one be transformed into the other by changing one color at a time, maintaining an H-coloring throughout. This is the same as finding a path in the Hom(G, H) complex. For H = K k this is the problem of finding paths between k-colorings, which was recently shown to be in P for k ≤ 3 and PSPACE-complete otherwise. We generalize the positive side of this dichotomy by providing an algorithm that solves the problem in polynomial time for any H with no C 4 subgraph. This gives a large class of constraints for which finding solutions to the Constraint Satisfaction Problem is NP-complete, but finding paths in the solution space is in P.The algorithm uses a characterization of possible reconfiguration sequences (paths in Hom(G, H)), whose main part is a purely topological condition described in terms of the fundamental groupoid of H seen as a topological space.