Easy way to create a retry button

Hey there , i want to ask you how i could create a retry button for multi level game ? should i create a fonction in pause scene for each level or there are something easier to do.
is there are something to create a one pause scene and implemented in each level and when i click the retry button the function of retry button know each scene was it ? is that possible ? please answer me and thank you in advance :pray: :pray:
sorry for bad english

I think you can implement anything you want. I pause my games before I reload levels as sometimes I run a cutscene between levels.

void PauseScene::Retry(cocos2d::Ref* pSender)
{
        /*auto scene = Level1Scene::createScene();
        Director::getInstance()->popScene();
        Director::getInstance()->replaceScene(scene);*/
}

so i do like that but if i complete like that i have to create a function for every level is there are a easy method :pray: :pray:

why can’t you pass parameters or use a hash map or vector or some way to keep track of “level name” and “level scene”.

I think some frosted magic is at Game Programming Design patterns