Moves pave the way for the social media site to be restored in the country after a stand-off with judge