I do see other similar questions, but I dont really understand why this happens. For now, I am using git reset --hard HEAD then manually adding back my changes.
As mentioned in "Why is Git telling me “Your branch is ahead of 'origin/master' by 11 commits.” and how do I get it to stop?"
"your branch is ahead by..." => You need to push to the remote master.
Run "git diff origin/master" to see what the differences are between your local repository and the remote master repository.
If you're ahead of the remote repo by one commit, it's the remote repo that's out of date, not you.
Pulling wouldn't help.
Now check also if you are actually on a branch (and not on a detached head).
This is your case here (you are indeed on master branch)