Well... Even if you unroot and fastboot flash stock recovery, it won't undo any changes to the system, most people who attempt this fail and leave their device either unbootable or not updateable. BTW, if you had a custom ROM none of this would be an issue because updates to custom ROMs are designed to work with TWRP and customization. Unfortunately, with how Google has implemented security changes and checks, updates on Lollipop and newer Android cannot be applied to modified devices.
Here is my opinion on this, and it is not always liked:
If you have an Android device, especially if it is a modified one, you should ALWAYS be ready and willing to reset it at any time... Use Google Photo or some other cloud based app to maintain backups of pictures and videos, perform regular cloud backups of SMS/MMS messages (SMS Backup & Restore is great for this), perform regular backups in TWRP and with TiBu or UltiBu, and always enable and use Google's backup service and maintain file copies on a microSD card, PC, or other cloud storage... personally I usually do this weekly but that is because I make lots of changes to my device. There are also many tools that can automate this process, such as Tasker.
Additionally, I see little to no advantage to rooting a stock device, a stock rooted device has immediately been limited in regards to updates, with older devices this isn't an issue because updates are done, but on newer ones it is a serious pain. Stock and rooted is a waste of time... if you want to root you might as well go ahead and flash a custom ROM, otherwise leave it pure stock without root. This may seem an odd statement from a guy who has written several rooting tutorials, but it is my view on this.
Again, this is my opinion... if you modify, be ready to lose everything at any time, if you are then this isn't an issue, and if the worst happens, like you drop your phone in the river or smash the screen, or you just get a new device, you always have some source for the information to restore back to a device.
---------- Post added at 09:53 AM ---------- Previous post was at 09:47 AM ----------
TWRP has a backup tool, use it... you can restore to that exact point at any time, it's called a nandroid backup and is a dump of each partition of the phone, restoring it will essentially bring the phone back to that exact moment in time. Remember that the default save point for this is on internal storage, which can/will get wiped, so save to the SD card and/or copy it off the device.