~ is the NOT operator in SQL, so for a bit column, to flip a value the statement would be something like this:
UPDATE dbo.Users SET Optin = ~Optin WHERE Id = @id
Just found this today and after using SQL for so many years, this will definitely come in handy going forward.