Djokovic had further surgery on a persistent elbow injury in February. "It felt like first match I ever played on the tour. Very weird", Djokovic said.
Daniel was victorious after two hours and 30 minutes and benefitted from 61 unforced errors from Djokovic, who has won 12 Grand Slam singles titles.
"It feels insane. I mean, I'm still in shock", Anisimova said.
Daniel, ranked 109 in the world, claimed the biggest win of his career as the qualifier prevailed 7-6 (7/3) 4-6 6-1.
In other action, current world No. 1 Roger Federer picked up where he left off, winning the four games he needed to defeat Federico Delbonis after their match was interrupted the night before by rain.
The match was carried over from Saturday after rain force play to end early with Federer one set up and the scores locked at 2-2 in the second.
Federer is making his 17th appearance in the California desert and is assured of remaining world number one if he makes it to the semi-finals.
INX Media case: ED can't arrest Karti till March 20
A Delhi court on Monday sent Karti Chidambaram to judicial custody till March 24 in the INX Media case, ANI reported. Karti Chidambaram was produced before Delhi's Patiala House Court on Monday after his three-day CBI custody ended.
Federer will face 25th-seed Filip Krajinovic in the third round. "When you go away from the game for over a two-month period, it starts feeling a little bit that way".
The defeat was just the fifth time in the past decade former world number one Djokovic has lost against a player outside the top 100 players in the world.
"He just seems to be getting better and better, he's improving year on year and as we said earlier, he's won nine titles since coming back from that injury problem with the knee".
The five-time Indian Wells champion regained his composure and the momentum by breaking for a 4-3 lead in the second, only to again struggle to get the job done.
Japan's Kei Nishikori withdrew through illness before playing his opening match of the tournament. "To me, it's not that surprising", Federer said.
"I think it's only (a matter of) time to get where he deserves to be", said Del Potro.
"But he's strong enough to deal with that, and I love him and I want to see him in the top positions very soon".