Reputation: 143
I find it pretty helpful to see the files and precisely which files have been changed in vscode (the green for additions and the red for deletions). Now that I have used git add
, commit
and push
, those are gone. Can I undo those commands so that I can get my helpful colors in vscode again?
Upvotes: 1
Views: 1126
Reputation: 536027
After add and commit, you have no modified files (in comparison to HEAD). After push, you have no outstanding commits (in comparison to the remote). Therefore you are at a completely neutral state and there is nothing to mark. That's why the marks are gone.
If you merely want to know what you changed in your most recent commit, you can diff against the previous commit. But that does not cause the markings to reappear in the GUI.
However, here's a trick I like to use in this situation. Make a new branch, switch to it, and reset it (mixed or soft) to the previous commit. Presto, there's your "undo"! All your changes are illuminated in the interface again.
You can even continue working from this state: Make new changes, commit, and cherry pick that onto the real branch.
Upvotes: 2