How to use git pull force to overwrite local files?

Using git clean will permanently delete all untracked files and directories in your repository, and this action cannot be undone.

If you have untracked directories that need to be removed, you should use the -d option along with the -f option to force the deletion:

CAUTION: this action is irreversible!

git reset --hard HEAD git clean -f -d git pull

Before running git clean, it’s advisable to use the -n or --dry-run flag to see what will be deleted without actually deleting anything:

git clean -n -f -d

For example, the output might show:

Would remove untracked-file-1.txt Would remove untracked-file-2.txt Would remove untracked/folder

This allows you to review the list of files and directories that will be deleted before executing the actual cleanup.