If you copy modified and untracked files from git repository to deployment directory you can use the below command
cp -a $(git ls-files -mo ./path/directory) directory_path
If you want to revert change for specific file. Use the below command
git checkout [commit ID]~1 -- path/to/file