I always stayed confident that he would win one slam again (only recently I started having few doubts because great competitors -Djokovic, Nadal- prevented him several times),
but I never thought he could be back to number 1 again until very last months.
Wimbledon is the greatest, but the "miracle" is not only about Wimbledon :
he also won the WTF, Bercy, Indian Wells, Madrid, Dubai, Rotterdam, Basel ... all of these tournaments were great feats. He only lost one final (Halle) but in Halle, the huge win against Raonic was the key for getting the number 1 this monday.
And just to realize how much of a miracle and a fight it was to reach that, in nearly all of these tournaments, there were matches where he really had to fight deep and which depended on a few points : Benneteau in Wimbledon, Tsonga in the WTF, Raonic and Bellucci in Indian Wells, Raonic and Berdych in Madrid, Del Potro in Dubai, Davydenko in Rotterdam ... he won all of these !
Which is a miracle !
The only tight match he lost was the US Open semi against Djokovic
I personally don't think he has played better recently than since he started back with Annacone, which was the real start of the "new Federer" imo, and I do think personally that 2011 was a great great year for Federer, especially in slams.
But he got this number 1 through winning all of these very tight fights !
And the way he reacted to the US Open loss is huge and a key to all that ... as he said himself and as he said he hopes Murray can do the same about the recent loss, which is not certain from McLagan's and a few others' words.