A long time ago when I was a Weight Watchers member I had been a chocolate muncher for a long time.
Weight Watchers got me away from chocolate (even though I had been eating some every second day prior to joining and had once shakingly even eaten a large spoon of unsweetened cocoa powder just to satisfy my desperate chocolate craving)
After keeping away from the stuff for several weeks I found I no longer craved it, even when others ate it in front of me.
It's funny I use to convince myself that my body must be lacking something in the cocoa to be wanting it that bad,
but of course that was a load of nonsense.
So in answer to you question. Yes, I truly believe cutting out foods you crave can stop you wanting or needing them.