The actor played Luke Skywalker in the original trio of Star Wars films and is reprising his role for the new film - along with former co-stars Harrison Ford and Carrie Fisher.
He said that it was a surprise to be back but he said the old guard were there to support the new members of the cast recruited by director JJ Abrams.
Hamill said: "I thought even if they did a third trilogy, we couldn't be involved because it's really about the new generation of characters. You know we're just there to lend our support and grow contractually obligated beards.
"It was certainly unexpected. I already had a beginning, middle and end. I never thought we'd come back. To go on to those sets that evoked so many memories, it is just astonishing.
"It just seems like an unexpected gift."
He went on to heap praise on the new generation of actors in the Star Wars cast, saying: "These kids - they are not kids - but they are so talented. They are also diverse. There are people I recognise like Andy Serkis and new people that I've never seen before like Daisy Ridley.
"But they are so good. I'm thinking of asking them for advice. I don't want to give any myself."
Hamill said he had heard Ford was "doing well" with his ongoing recovery from an accident on-set last month which left him with a broken leg. Ford, who returns as Han Solo, is reported to have been hurt after a mishap with the door of the Millennium Falcon.
Hamill said: "I was not on set. It was really terrible but I hear he's doing really well. It will take more than that to stop Harrison Ford."
Star Wars: Episode VII is due to be released in cinemas on December 18, 2015.