We get into the flow, moving fast, committing fast, then... uh-oh, we committed
too soon. Usually two seconds after clicking
Commit. Fortunately PyCharm makes
it easy to undo the commit if it hasn't yet been pushed.
Go to the
Version Control tool window and click on the
Log tab. Then
right-click on the commit and choose
Undo from the context menu.
The changes in that commit need to go "somewhere." In PyCharm, that
"somewhere" is called a changelist. You can send that commit's changes to
a new changelist (by default, one labeled with the commit message) or to
Default Changelist. Then click
You can now deal with the changes in that commit using normal "changelist" machinery. It's as if the commit never happened.