You seem to ask your question on the premise that git keeps a "list of files which have been changed". It does not. Each git add updates the index, and when a later command (status, commit) needs to know what's to be committed, it is computed from analysing the HEAD commit, the index and the working tree. As a sidenote, we could have done without the defensive disclaimer about downvotes. Let people do their thing and focus on the subject matter, if I may. Agreed with user207421: XY problem here. (Btw, this is not an insult to you, it's a judgement on the question.)