Yes, after a couple of tanks the ecu will adapt the knock sensor to take advantage of the higher octane fuel. A couple of tanks of 95 and it will adapt back to that, with potentially, depending on the engine, a loss of power. It would not, however, 'remember' in the sense you mean, it will...