Check the version of git on typing git -- version in terminal . once got git version then
Check if you're in a Detached HEAD state
Go to View > Git Repository.
If it says HEAD instead of a branch name, you are in a detached HEAD.
check if the branch was deleted or renamed remotely
Go to Git > Manage Branches in Visual Studio.
See if any branch is listed under Remotes/origin/.
If you see only main and not master, then maybe master was renamed to main on GitHub