Is there a way to recover data from the Ubuntu file system after formatting the hard drive and installing Windows?

I had an Ubuntu installation that contained some important data, then somebody mistakenly formatted my hard drive and installed Windows 10. Is there a way to restore some of the files I had on Ubuntu?

The file system of Ubuntu was ext4, and Windows 10 is NTFS.