The revolution described in Les Misérables is one which Victor Hugo actually witnessed, and which is sometimes known as the Second French Revolution. Fighting broke out in July 1830 and initially lasted for just three days, after which the Bourbon King Charles X was replaced by his cousin, Louis Philippe.
Although King Louis Philippe was initially popular, his eighteen-year reign was a turbulent period, marked by famine, violence and, in 1832, an outbreak of cholera. On June 1, 1832, General Lamarque, a parliamentarian who had become a hero to many people in Paris, died of cholera, and riots broke out after his funeral. These led to the republican insurrections known as the June Rebellion or the Paris Uprising of 1832.
Victor Hugo was thirty years old at the time of the June Rebellion and was initially unaware that it was happening, having been immersed in his writing. On June 5, 1832, he was caught in crossfire between the two sides. When he came to write about the rebellion decades later, and after the more politically significant revolution of 1848, the events of 1830–1832 had largely been forgotten. This is one of the reasons why Les Misérables is often assumed to be set during the first French Revolution of 1789.