Comment by Certhas
Comment by Certhas 2 days ago
The real "internal model" of git contains much more data/moving parts.
There isn't one tree of commits, there are typically at least two: local and remote
Branches are not just pointers to commits, but also possibly related to pointers in the other tree via tracking.
Stash and index and the actual contents of the working directory are additional data that live outside the tree of commits. When op says "avoid git reset hard" it's because of how all these interact.
Files can be tracked, untracked and ignored not ignored. All four combinations are possible.
None of these seem to preclude a command to make an arbitrary branch point to an arbitrary commit without changing anything else.