Green’s Dictionary of Slang

unhook v.

1. to release from being arrested or in prison [fig. use of SE].

[US]A. Zugsmith Beat Generation 59: ‘You know who got you unhooked?’ he said softly. ‘Me.’ [...] ‘That’s how come you’re out of stir, man.’.

2. (drugs) to stop taking narcotics [hooked adj.3 ].

[US]H. Simmons Corner Boy 47: I’ll get unhooked yet.
[US]C. Cooper Jr Scene (1996) 154: You got hooked and you couldn’t unhook yourself even though you were afraid.