I'm sure these kinds of questions fall within some fairly central fields of philosophy: what makes "me now" and "me 10 seconds, months, or decades ago", the same person? In what sense are these "the same person" and when would we be justified to treat them (fully or to an extent) as different people? It can't be continuity of self, because we hold that a person is "the same person" even after a discontinuity (change of consciousness, belief, physical body..). How do we distinguish "It was me but I wasn't the same then/I wasn't responsible for myself" from "It wasn't me period".
(As a side issue, one argument more heard societally is, are there times when "that wasn't me!" (the me-that-is-now) is a legitimate argument or defence for a poor choice or action at another time? Relevant wiki article)
I'm curious to learn more about the different philosophical perspectives on this that are raised, but I'm not sure how to look it up or any key words or major perspectives to look for.
A starter in this area would let me explore more by myself. Thanks!