General Robert E. Lee was the commander of the Confederate States Army during the Civil War of the United States. Since 1862, he was in front of the Army of Northern Virginia until 1865, year in which he surrendered.
During this time two of the last battles that General Lee fought were the battle of Fort Stedman, and the battle of Five Forks, both lost.
The battle of Fort Stedman (1865): It was the last failed attempt from General Robert E. Lee before his complete surrender to the overall Union commander, General Ulysses S. Grant. The two armies had fought since 1864 settling into trenches that stretched around Petersburg and Richmond; this battle was part of this campaign. The Confederate army lost almost 3,000 soldiers, and 1,500 were captured after several military movements making Lee's army outnumbered making impossible to maintain much longer the Petersburg line much longer. 2 weeks later Petersburg fell favoring the Union and leading to the surrender of General Lee at Appomattox Court House in Virginia.
The battle of Five Forks (1865): General Robert E. Lee ordered General George Picket along with his infantry and cavalry division of Colonel Thomas Munford to hold the crossroads of Five Forks. Pickets strategy was not well constructed and the cavalry force was established in areas difficult to maneuver. The Union pushed the right flank of the Confederate line and attacked the left flank capturing many prisoners. The last line that fell under the Union and the definite defeat for the Confederate army was the center at the line of the road junction. This victory for the Union threatened Lee's last supply line forcing Lee to inform President Davis that Petersburg and Richmond should be evacuated.
I hope this answer helps! Happy Holidays!