The #quit extended command lets you quit and abandon the current game. NetHack will ask you to confirm with [y/n]. Use this when you want to abandon your current game and start a new one with a new character.
Once you quit, there is no way to return to that game! (That is unless you are save scumming.)
In old versions of NetHack, as in Hack, the [Q] command would quit. However, such command is rarely used, so newer versions changed [Q] to quiver and introduced the extended command "#quit". This is why, on your first use of the quiver command, the game will remind you to use "#quit" to quit.
If you only want to save your game, you would press [S]. This exits NetHack; but it leaves a save file so you will return to your current game. Using "#quit" never leaves a save file.