How to exclude subfolders when using volume?

version: '3'
services:
  nginx:
    image: nginxtest
    container_name: nginxtest-container
    volumes:
      - "$PWD:/apps"
    ports:
      - "80:80"

Above is my compose file.

I have created dummy file in that directory. If I want to ignore or exclude changes made in one file and all other files should be reflecting the change as it is, how to do that.

Source: StackOverflow