When undoing changes it is required to know the different trees you work on in git. There are three trees, the Working Tree where you make changes locally before staging or committing, the Staging Index which corresponds to the Stage in git where your files are added to via git add, and the Commit History where the HEAD ref points and corresponds to files that have been committed to the local repository.
You can see options in reset that correspond to these three trees, where soft reset operates on the Working Tree undoing changes there, mixed which operates on the Staged Index i.e., where staged files will be reset to an Unstaged/Untracked state whilst retaining changes in the working directory and hard which operates on the Commit History and resets the HEAD to a specific point in that history, changing everything in the working tree and on the stage putting everything into a state created by the last commit or to that of a specified commit.
Working Tree -->Local Untracked/Unstaged files --> reset soft
Staging Index --> Staged/Tracked files added to Index but not yet committed --> reset mixed
Commit History--> The HEAD points here. It points to committed files in the local repository that will move to remote repository on next Push --> reset hard
On initial checkout of branch all three will be in sync.