Apple - How to remove the default application for opening a file?

Use RCDefaultApp. With it, you can set the file association to <disabled>
Another option is to use the command line and lsregister. lsregister is located in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/ To see all the available commands, run /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister. See this article for more information.


@Manav proposes in a comment a straightforward and non intrusive way which worked perfectly for me, and I think should be an answer. In a terminal window, run:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -u /Applications/Foo.app && killall Finder