For many years, I've had home folder ~ correspond to c:\cygwin64\home\User.Name. I recently had a problem that I tried to solve by uninstalling and reinstalling Cygwin. Since I rarely do this, I went through the processof googling how to set the home directory away from c:\Users\User.Name to c:\cygwin64\home\User.Name. In /etc/nsswitch.conf, I ended up changing db_home: to /home/%U, which did the trick.
I then found that all of the previous folder trees rooted in ~ were gone. Of course I try to diligently back up snapshots of my work to a network drive, but being busy, I last did this 10 days ago. After spending time reconstructing content from material distributed all over the place, I've mitigated my losses.
I do wonder, however, is reinstalling Cygwin supposed to wipe out all of the content in ~, specifically when it corresponds to c:\cygwin64\home\User.Name?
I just now noticed that all of the lines in /etc/nsswitch.conf are commented out with a leading #, include the db_home: line. This means my setting had no effect. It seems that just by restarting Cygwin a few times (by which I mean launch mintty or X-windows + xterm) and shutting them down, ~ seemed to change by itself from c:\Users\User.Name to c:\cygwin64\home\User.Name. I'm not entirely sure, however, because I didn't really know what I was doing when I was messing around with changing the mapping of ~. However, I don't recall changing any files other than /etc/nsswitch.conf.
$HOMEis/home/chris, which corresponds toc:\cygwin\home\chris. I would have had to change stuff to getc:\users\chrisas my home directory