I just overwrote my folder while mounting a hard disk drive. How do I undo/recover it?

Solution 1:

All the files are still there, you just can't get at them since the mount point has changed the system's ability to resolve files in /Users/whatever (a.k.a.~)

Going forward, try mounting the drive under /Volumes (as in sudo ext4fuse /dev/disk2s7 /Volumes/myDrive)

You should probably reboot the Mac since many programs will have issues saving work to the home folder. If you are working on some important documents, maybe save them to /Users/Shared if you wish, but hopefully you have a good backup system in case this messed things up more than expected.