Have you ever found yourself in a situation where you’ve modified a local code file and needed to revert back to a previously saved local version that was not committed to your Git repo?
If you’re a user of Visual Studio Code you’re in luck because I’ll show you how to do just that …
Whilst exploring the myriad of menu options and panels available in VS Code … I recently stumbled upon a little-known feature of Visual Studio Code called the “timeline” which displays a running history of a given file.
You can find it by opening a given file in VS Code and towards the bottom of the File Explorer menu you will notice a panel called “TIMELINE” which displays the running version history of a given file. It displays your local file save history (uncommitted changes) and Git repo commits all in one place. It’s a very hand, yet little-known feature of VS Code.
Clicking the entries in the Timeline panel will show a diff comparison of the changes made.
One important thing to note is that the local file save history will only be tracked if you edit the file using VS Code. Therefore if you edit the file outside of VS Code you will not see any file version history.
Visual Studio Code sometimes can make you feel like a kid in a candy store … there are so many flashing lights and knobs to turn that it can sometimes become a little bit overwhelming. I often feel like I’m barely scratching the surface of its extensive feature set. With that said, I hope you’ve learned something new about Visual Studio Code from this post.
If you have any other VS Code tips you wish to share. Feel free to post them in the comments below to help other developers out there.
Happy coding! 🙂
- Solved: Intermittent SharePoint Framework Caching and 404 deployment errors - 17th August 2023
- Solved: Azure Functions There is not enough space on the disk - 21st July 2023
- How To: Find Duplicate Lines Using Notepad++ - 15th June 2023