When you work with with version control, you sometimes find yourself in situations when you would like to edit or delete the saved changes in your project’s history. Well, in this case, you should know that rewriting your project’s history could be dangerous.
Ever had to work with multiple AWS accounts? If so, then you probably have a working solution on how to make switching accounts easier, in which case don’t hesitate to share it with me in the comments below. But if you still find troublesome managing your multiple AWS credentials, then you should find this post interesting.
Imagine a situation when you start working on some part of your project, make a bunch of uncommitted changes, but something urgent comes up that requires you to quickly make a few commits concerning another part of the project. In such cases, instead of losing the work you have already done, you can use git stash command to save your uncommitted changes away for later use while switching to another task.
In cases when you use git reset --hard to undo some commits, you basically erase commits. In cases you happen to change your mind about the commits you deleted, Git still provides an easy way to restore those commits with the help of reflog.
We continue to talk about git and in this post we’ll talk about a few more things that make people confused - viewing old versions of your files and undoing commits.