Go to Preferences (macosx) > Miscellaneous > Files
In the textarea Ignored Files Patterns enter
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$
By removing the the |^\.(?!(htaccess|gitignore)$).*$
from the default value you tell Netbeans not to remove any hidden files