Funnily enough, git doesn't actually allow you to 'change' any history.
It allows you to make new history, and the old history might get garbage collected eventually.
It allows you to make new history, and the old history might get garbage collected eventually.
Basically, almost everything is immutable in git, apart from tags and branches: these are mutable pointers to immutable commits.