I just created a new scratch org and then went to push the current metadata source to it with the command:
The failed with an error:
ERROR running force:source:push: Expected file at path: D:\p\force-app\main\default\classes\BatchClassThatDoesNotExist.cls-meta.xml
Which seemed odd, as there never was a
BatchClassThatDoesNotExist class in the project. Somehow there was a BatchClassThatDoesNotExist.cls in the file system (but no corresponding .cls-meta.xml). I chalked that up to some oddity that accidentally created a new file and just removed the offending file BatchClassThatDoesNotExist.cls.
Now when I attempt the same push operation to the scratch org I get the error:
ERROR running force:source:push: Expected file at path: D:\p\force-app\main\default\classes\BatchClassThatDoesNotExist.cls
Which seems odd, as I just intentionally deleted that file in VSCode.
How can I get the source pushing to the scratch org correctly without the unwanted class?