how do I retrieve photo I accidentally deleted on my Samsung Tab 4

Go to the Play Store and download Root File Manager and install it. Use it to find the folder Lost.dir which is Android's equivalent to Windows' Recycle Bin. You might strike lucky.