After going through the usual course of study for the military profession, he entered the army as an engineer officer in 1824, and served in the Morea (Peloponnesus) in 1828, becoming captain in the following year. When the revolution of 1830 broke out he was stationed at Arras, and was the first officer of his regiment to declare for the new order of things. In 1831 he was removed from active duty in consequence of his declared republicanism, but in 1832 he was recalled to the service and sent to Algeria.
This continued to be the main sphere of his activity for sixteen years, and he won especial distinction in his fifteen months' command of the exposed garrison of Tlemcen, a command for which he was selected by Marshal Clausel (1836-1837), and in the defence of Cherchel (1840). Almost every step of his promotion was gained on the field of battle, and in 1844 the duc d'Aumale himself asked for Cavaignac's promotion to the rank of maréchal de camp. This was made in the same year, and he held various district commands in Algeria up to 1848, when the provisional government appointed him governor-general of the province with the rank of general of division.
The post of minister of war was also offered to Cavaignac, but he refused it owing to the unwillingness of the government to quarter troops in Paris, a measure which the general held to be necessary for the stability of the new régime. On his election to the National Assembly, however, Cavaignac returned to Paris. When he arrived on May 17 he found the capital in an extremely critical state. Several émeutes had already taken place, and by June 22 1848 a formidable insurrection had been organized.
The only course now open to the National Assembly was to assert its authority by force. Cavaignac, first as minister of war and then as dictator, was called to the task of suppressing the revolt. It was no light task, as the national guard was untrustworthy, regular troops were not at hand in sufficient numbers, and the insurgents had abundant time to prepare themselves. Variously estimated at from 30,000 to 60,000 men, well armed and organized, they had entrenched themselves at every step behind formidable barricades, and were ready to avail thamselves of every advantage that ferocity and despair could suggest to them.
Cavaignac failed perhaps to appreciate the political exigencies of the moment; as a soldier he would not strike his blow until his plans were matured and his forces sufficiently prepared. When the troops at last advanced in three strong columns, every inch of ground was disputed, and the government troops were frequently repulsed, till, fresh regiments arriving, he fotced his way to the Place de la Bastille and crushed the insurrection in its headquarters. The contest, which raged from June 23 to the morning of June 26, was without doubt the bloodiest and most resolute the streets of Paris have ever seen, and the general did not hesitate to inflict the severest punishment on the rebels.
Cavaignac was censured by some for having, by his delay, allowed the insurrection to gather head; but in the chamber he was declared by a unanimous vote to have deserved well of his country. After laying down his dictatorial powers, he continued to preside over the Executive Committee till the election of a regular president of the republic. It was expected that the suffrages of France would raise Cavaignac to that position. But the mass of the people, and especially the rural population, sick of revolution, and weary even of the moderate republicanism of Cavaignac, were anxious for a stable government. Against the five and a half million votes recorded for Louis Napoleon, Cavaignac received only a million and a half. Not without chagrin at his defeat, he withdrew into the ranks of the opposition. He continued to serve as a representative during the short remainder of the republic. At the coup d'état of December 2 1851 he was arrested along with the other members of the opposition; but after a short imprisonment at Ham he was released, and, with his newly-married wife, lived in retirement till his death at Ourne (Sarthe).
His son, Jacques Marie Eugène Godefroy Cavaignac was a prominent politician.