Back into the hat but maybe not necessarly back to wonderland. When we saw him enter the hat the first time there were many different doors. I think he likely went back to Fairytale Land (because based off episode 5 is underneath Storybrooke).
Into the hat! Emma is the one who can break the curse after all, it would make sense that she got the hat to work. I think a part of her believes in the curse even if she doesn't want to admit it.