Kent Beck wrote up a workflow along these lines called test && commit || revert. The idea is any change that makes the tests pass is committed, any change that makes the tests fail is reverted. https://medium.com/@kentbeck_7670/test-commit-revert-870bbd7...
I believe Kent has also posted a few videos on YouTube demonstrating this approach.
I believe Kent has also posted a few videos on YouTube demonstrating this approach.