Forgetting previous changes

I’ve noticed this many times, and I’ve always been able to keep ahead of it, but changes made without the help of AI aren’t in the memory, so it doesn’t know that the changes were made, and then suggests they should be undone on each diff.

Today I lost some code when I didn’t notice in the diff that a block of code was removed, and had to put out a hotfix to bring it back.

It would be helpful if the AI could work off of what ever files are necessary as they currently exist, and not how it is the previous context window.