Latest time to reverse a declined PhD offer
It is likely that there is no longer a slot open for you. But under the circumstances you state, the latest time to contact them is probably now. Once you declined an offer they moved on and accepted others. If those others have been accepted there is no longer room until the next class. 

But if you are willing to wait a year, then you can probably enter the pool again and be considered like anyone else. 

However, it also just sounds like a case of "buyer's remorse". Your situation at B sounds like it would work out fine.