Murray, the champion in 2013 and 2016 but who has fought a long battle with hip and groin injuries in recent years, triumphed 6-4, 6-3, 5-7, 6-3 over the 24th seeded Basilashvili.
“It has been extremely tough, even in the last few months,” said 34-year-old Murray.
“It was not the most serious of injuries but it was frustrating not to be able to get on the court.
“I have had so little momentum over the last few years but kept on going to the gym and trying to get back to do it again.”
Now ranked a lowly 118 in the world, former number one Murray will face either Oscar Otte of Germany or France’s Arthur Rinderknech for a place in the last 32.
His last appearance in the singles tournament at Wimbledon four years ago ended in a five-set loss to Sam Querrey in the quarter-finals.
A long-standing hip problem, which required surgery, then pushed him tearfully to the brink of retirement.
It was a roller-coaster evening for Murray who let slip a 5-0 lead and two match points in the third set.
That led to a delay in proceedings to allow for the Centre Court roof to close.
But Murray broke in the first game of the fourth set to send him on his way to victory.
“There was some fatigue there and I was just trying to just sort of not get too amped up or too hyped up,” he said.
“The crowd definitely were into it. I think people are just desperate to be out watching sports or going to the theatre, whatever — people just want to go out and do stuff and have a good time.
“I realised the last 18 months not to take moments like that for granted. You know, enjoy those things that we love doing.
“I think everyone was into it today. It was a really good atmosphere, and it didn’t feel like the crowd was half full.”
Wimbledon, which was cancelled last year, is operating at just 50% capacity until the finals weekend when 15,000 people can attend the championship matches.
Three-time major winner and back-to-back Olympic gold medallist Murray said he intends to keep playing.
“I keep on being asked will it be my last match or my last Wimbledon,” he said.
“I don’t know why I keep on being asked. I want to keep on playing. I enjoy it and I can still play at the highest level.
“Basilashvili is ranked 28 in the world and I beat him.”
Basilashvili was generous in defeat.
“It’s an unbelievable effort for him after surgery, after so many comebacks to come back and fight,” he said.
“He fights unbelievably, and I was expecting that. We all know that how big a fighter he is on court.”