We’ve all been there. Investigating a bug, making some code changes, then finding that these changes don’t fix the bug. Rinse, repeat, and two hours later we realize that first attempt needed just a little tweak. How can we roll back to it if we did not commit it to Git or Mercurial? How can we roll back any change we made to the code base between source control commits? Undo only goes so far…
In JetBrains Rider, there’s a solution to that: Local History. It’s a real-time, local version control that keeps track of changes we make to our code base.
What is Local History?
When we’re “in the flow”, our project and source code constantly changes. We write, refactor and debug, and when we finish a task, code is committed to a version control system (VCS) like Git or Mercurial.
Unfortunately, commits to the VCS are just snapshots. If we’re lucky, changes in between commits are captured in the undo stack, but that disappears if we close the IDE and reopen it a later time. Undo also does not track external changes, made outside of the IDE. What’s even worse: don’t you hate it when you undo 20 times, then accidentally press the keyboard so you can’t redo anymore?
Continue reading →