I suggest you give the docs a read first when you have a question about a command line utility. Generally you can replace all other options with --help to display the documentation.
git push --help
Try running the above and scrolling down to the explanation of the -f, --force option.
But to put it plainly, youâve already pushed your local branch up to the remote repository on GitHub. If you make further commits locally and push again, git is, by default, going to make sure the history of your local branch matches that of the remote branch before allowing the push. So if you were to change the history of your local branch via reset and try to push again, git wonât let you.
But in a case like yours, where youâre certain that you and only you are working on the branch, then you can tell git to just do it with the --force option on git push.
Am I supposed to see the files back as they were when using git reset HEAD, because I donât? And the files are as they were after I changed and pushed them using --hard:
PS C:\Users\14844\Documents\WebDev\repos\freeCodeCamp> git reset --hard HEAD
HEAD is now at 918418c2b5 fix(curriculum): typos in Beta Registration Form
PS C:\Users\14844\Documents\WebDev\repos\freeCodeCamp>