try the command
$ git reflog
above command will give you tips of branches and other references that were updated in the local repository like below (Recent updates are at top)
da82426 (HEAD -> main) HEAD@{0}: reset: moving to HEAD
da82426 (HEAD -> main) HEAD@{1}: reset: moving to HEAD~
774b952 (origin/master, origin/main) HEAD@{2}: reset: moving to HEAD
774b952 (origin/master, origin/main) HEAD@{3}: checkout: moving from master to main
8851ece (master) HEAD@{4}: checkout: moving from master to master
8851ece (master) HEAD@{5}: commit: First commit
8bd9080 HEAD@{6}: commit (initial): Initialize project using Create React App
Then revert to your desired stage by using command like below
$ git reset --hard 8851ece
It will probably get files back.