He can give the woman he performed temporary marriage with the time back and this will end the temporary marriage. The man can just terminate the temporary marriage, and if there is one month remaining, for example, he can just give it back to her. Then they can marry permanently