Note - this story is set after Valjean and Cosette leave the nunnery, but before the denoument at the barricade. Although it's non-canonical, it could slide into the timeline without making any great waves.
The Good Samaritan.
The man formerly known as Jean Valjean had not planned on encountering any form of excitement that day. His intended drive around the more picturesque byways of Paris, but Cosette had begged him to change their route to tour as much of the city as possible, keen to explore and see how her fellow Parisians lived after her sheltered upbringing. Jean had been unable to resist so simple a request and he'd asked the driver to adjust their route accordingly. As the carriage turned into gloomier, narrower slum areas he worried about how the squalor might affect his darling child.
Cosette seemed fascinated though, looking out of the window curiously, occasionally looking to her adoptive father imploringly as if to bed him to make it all better for the poor unfortunates in the slum and Jean made a mental note to turn some of his charitable efforts here.
His musings were cut short and his heart leapt in fear and sympathy as Jean noticed a gang of thugs terrorising some poor fellow and he called for the driver to halt as Cosette turned to him. The poor child gripped her skirts tightly, knuckles white and her whole frame tense with pain on the stranger's behalf. Jean paused, hand on the doorhandle as he took in the situation.
The victim was favouring one side slightly, evidently compensating for some sort of wound or injury and his black hair was heavily streaked with grey, but his bearing remained proud and he was fighting the five ruffians with all of his might, a sixth lying unconscious nearby. Jean had to admire such a determined spirit. Then the man happened to turn slightly as he dodged another attack, displaying impressive sideburns and unusually dark skin. Those and the distinctive hat, which Jean noticed had fallen to the ground in the affray made the man's identity all too clear.
Javert was tiring though and for the shortest of moments Jean knew that if he didn't help l'inspecteur would be killed or crippled. The one man keeping him from complete freedom would be gone. Then the moment passed and the compassion and strict moral code the Bishop had bought for him with silver resurfaced. He snatched up his walking stick and leapt from the carriage, just as Javert went down from the weight of numbers opposing him.
He swung the stick with all his tremendous strength, knocking the nearest assailant to the ground, winded. The second man turned at that and noticed the white-haired old man who had just taken down one of his comrades with a single blow. By the time Jean had driven away the rest of the brigade of hooligans Javert had succumbed to unconsciousness, a puddle of blood seeping across the pavement under him. Jean winced at how painful the knife wound must be and gently lifted his sometime nemesis, carrying him to the carriage where Cosette rested Javert's head in her lap, speaking gently to him as she tried to staunch the flow of blood with her handkerchief.
The injured man's eyes opened slightly and Cosette smiled down at him, pushing him firmly back into a prone position as he weakly tried to rise. Instead she placed a firm but gentle hand on his chest and sang a hymn, hoping to soothe him while they hurried to the hospital.
Javert woke and looked around in confusion at his unfamiliar surroundings before a vicious jab of pain reminded him of why he would be in the hospital. As to how he had come to arrive in hospital, he had no idea though. He had a vague memory of an angel with soft hands and golden hair singing psalms, although he suspected it had been a delerium. He even thought he'd caught a flash of prisoner 24601 too, but the convict had been playing a heroic role in his fever-dream, which was ridiculous! The mystery only deepened when one of the attendants arrived to check his wound and assured him that a mysterious benefactor had gifted the hospital with a generous sum of money, more than enough to allow him to remain in the hospital until he was fully healed.
Finally though Javert was well enough to return to his duty. The mystery remained unsolved, but with criminals to catch and justice to uphold Javert had more important things to think about than his mysterious benefactor. He settled his hat on his head and buttoned his coat, casually brushing a couple of white hairs from the cuff as he thought that the gang who had stabbed him would regret not finishing the job.
Note - Some might say that I made Valjean OOC by having the thought that delaying enough for Javert not to survive. I chose to write it that way as it's easy to be good if the thought of being bad never occurs to you. Being good when being bad might well get better results and you probably won't get caught... that's the true test of a character's moral strength I think. It also prevents him from basically being the French version of Dostoyevsky's Prince Myshkin.
Sorry if no-one likes this or you feel it's sketchy and incomplete, but the idea wouldn't leave me alone and I think working on the story in any moe depth will make it clunky and overly packed with redundant detail.