What were the terms of Robert E. Lee's surrender to Grant?

Grant gave Lee generous terms of surrender. The Confederate Army of Northern Viginia was fed (at that time they were starving because of the Confederacy's lack of supplies), allowed to keep their weapons, and sent home.

It is interesting to note that when Lee came to Appomattox Court House to surrender to Grant, Grant was so excited to meet the famous general that Lee had to remind him that they were there to arrange a surrender.