Use:
*.dll #Exclude all dlls
!foo.dll #Except for foo.dll
From gitignore:
An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources.