Can the disk digger app restore a file even after factory reset I recently read about how disk digger app works for android, I wanted to know if the app could search the memory and find the deleted files even after doing factory reset?
Yes, but not reliably.

If you want to prevent this, zero and/or encrypt your device.

If you want to maximize file recovery do as little as possible with the phone and backup with adb pull /dev/block/mmcblk0 mmcblk0.img from recovery (tested with TWRP) then use photorec.