It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files).
If I commit this file, I
SVN version 1.5 supports removing/deleting a file from a repository with out losing the local file
taken from http://subversion.tigris.org/svn_1.5_releasenotes.html
New --keep-local option retains path after delete..
Delete (remove) now takes a --keep-local option to retain its targets locally, so paths will not be removed even if unmodified.
For SVN you can revert files you haven't committed yet. In TortoiseSVN you just right click the file in the commit window and choose Revert...
On command line use svn revert [file]
Don't know about GIT since I've never used it.
Two simple steps in SVN:
1. Add this directory in parent directory's svn:ignore property:
svn propedit svn:ignore .
2. Remove directory:
svn rm mydir
3. Commit
Please note that when other developers do a svn update, that directory will not get deleted. SVN just unversions it instead.