I can't understand it's usage because tilde is not a metacharacter in Regular expression.
I saw it here:
https://github.com/spring-guides/tut-rest/blob/master/.gitignore
Some editors like emacs make backup files that end in a tilde, so this rule would ignore any backups made while editing .gitignore itself