Toshack was critical of the 27-year-old's contribution and dropped him from two squads, with injuries ruling him out on other occasions.
But Earnshaw is back in the frame now and determined to make his mark in the World Cup qualifiers in Cardiff against Finland on Saturday and Germany next Wednesday.
Earnshaw, who has scored 13 goals in 41 appearances for his country, has revealed his hurt at being overlooked by Toshack.
His nightmare time at Derby last season, when he was shunned for months, certainly contributed to Toshack's decision with the player low of confidence.
Earnshaw said: "It has been a long road back for me, it has been hard and I have picked up injuries, which has not helped much.
"But the objective has always been to get back into the Wales squad. That has been the aim, I want to play every game for Wales."
Earnshaw escaped his Derby hell last summer and although Forest are deep in a relegation battle, he has scored 14 times this season and in recent weeks has looked back to his best.
He said: "My ambition is to do well in this Wales team, and for the team to do well. We have a good, young, squad that needs to be in touching distance of qualifying for tournaments.
"That is what everyone wants, I am the same. Maybe it could have been a case of me deciding to retire (from international football)and throwing my toys out of the pram.
"But I took a long, hard look at things and the case was clear, I needed to be back in the squad and to be given my time to show what it means to me.
"Going to Forest has been the key. It has been almost like a flip of a coin from the very worst things to the best. I have got plenty of goals this season and things have gone brilliantly on a personal level.
"From leaving Derby everything has changed. After only a few months I knew I needed to leave there, I was the wrong person at the wrong club at the wrong time.
"I needed to be at a good club and play matches and show that is what I was about. I just needed games to show that, and things have had a knock-on effect and I am back on the international scene."
He added: "Retirement did cross my mind. It was a thought, certainly. But in the end being in the Wales squad was important.
"There were times that I found out I wasn't selected only by watching TV. That was the lowest point for me, to find out that way that I was not in the squad.
"I felt it was just not right that I was not in there with the rest of the lads after so long in the squad.
"I decided that I needed to go away(leave Derby)and play football and everything else would fall into place."
Earnshaw had been a fixture in the squad for six years, scoring the winner on his debut against Germany in 2002.
He said: "I was so used to seeing my name in those squads. I was in the Premier League at the time, and I felt that I should be good enough to get into the squad.
"I still feel that is the case. But now I am 100 per cent fit and I am playing a lot of games and things have turned right around.
"My hunger to play for Wales has increased since I have been out of the squad. When I started games I scored a lot of goals and did myself justice.
"I was frustrated and annoyed. But being left out has made me tougher and stronger.
"It has given me that extra hunger. I am refreshed by going to Forest and I now want a lot more games and a lot more starts.
"I didn't take my selection for granted. But I felt that having been involved in everything for so long, I should have been in there.
"There's no bad blood. I am back now and just want to do my best for my country. I needed to score goals to prove that I should be involved for Wales. I just want to put the bad times behind me."
On the injury front, defender James Collins and striker Craig Bellamy have been declared fit to face Finland after hamstring and knee injuries.