Motivated by applications of soft-contact problems such as guidewires used in medical and engineering applications, we consider a compressed rod deforming between two parallel elastic walls. Free elastica buckling modes other than the first are known to be unstable. We find the soft constraining walls to have the effect of sequentially stabilizing higher modes in multiple contacts by a series of bifurcations, in each of which the degree of instability (the index) is decreased by one. Further symmetry-breaking bifurcations in the stabilization process generate solutions with different contact patterns that allow for a classification in terms of binary symbol sequences. In the hard-contact limit, all these bifurcations collapse into highly degenerate ‘contact bifurcations’. For any given wall separation at most a finite number of modes can be stabilized and eventually, under large enough compression, the rod jumps into the inverted straight state. We chart the sequence of events, under increasing compression, leading from the initial straight state in compression to the final straight state in tension, in effect the process of pushing a rod through a cavity. Our results also give new insight into universal features of symmetry-breaking in higher mode elastic deformations. We present this study also as a showcase for a practical approach to stability analysis based on numerical bifurcation theory and without the intimidating mathematical technicalities often accompanying stability analysis in the literature. The method delivers the stability index and can be straightforwardly applied to other elastic stability problems.