Say I have the following variable initialized within a class:

```
class testClass {
public:
    int someInt = 5;
};

```

and I want to add to or modify it using like this:

```
int main() {
    testClass *t = new testClass;
    cout << t->someInt << endl;
    t->someInt = 1;
    cout << t->someInt << endl;
    delete t;
    cout << t->someInt;
}

```

How can I revert the changes done by the `t->someInt` to `someInt` back to the initial declaration, of `int i = 5`?

Also, when I call delete before `cout << t->someInt` still exists. Why does the output of `t->someInt` still equals `1`? Shouldn't it have been deleted?

I am working on a game where it has present variables and I want to dynamically change the variables, such as a score, when the player gets a point to release memory and allow the player to replay the game after the variables are reverted back.