The reversal is aimed at securing the backing of Socialists to avoid the country’s fourth collapse of a government in less than a year.