In a git project, some files or folders are sometimes added or deleted locally, but we do not want to submit them. In general, we cancel all local modifications:
git checkout .
To cancel the modification of the specified file:
git checkout filename
To cancel the specified file deletion:
git checkout filename
Reverting to the previous version will resolve the entire folder deletion modification:
git reset --hard HEAD^
Cancel locally added files and all modifications:
git checkout . && git clean -df