Charles Dickens’ novel, A Tale of Two Cities, like most of his work, contains a number of complex and deeply drawn characters, including Sydney Carton. In A Tale of Two Cities, Dickens creates and develops a theme of regeneration. France, at least as far as the common man is concerned, is regenerated through revolution. Dr. Manette is regenerated by the love of his daughter Lucy. And Sydney Carton, at first despicable, drunken, and hopelessly narcissistic, is regenerated by own feelings and love for Lucy.
The quotation in your question occurs as Carton is sacrificing his own life in place of Charles Darnay, Lucy’s husband. Carton considers himself to have been “saved,” in a manner of speaking, by Lucy because she restored his appreciation of life. He expresses this appreciation to her a little earlier, in chapter 13:
I wish you to know that you have been the last dream of my soul. In my degradation I have not been so degraded but that the sight of you with your father, and of this home made such a home by you, has stirred old shadows that I thought had died out of me.
Since he has no hope of having Lucy for his own, he expresses his love for her in the ultimate sense, by sacrificing his own life for her happiness and well being. It is this selfless act that connects A Tale of Two Cities to the great events in mankind’s history that required such devotion to move humanity forward.