Session - Commit to main (and undo last commit!)
The pr_*
functions all relate to Pull Requests but it is possible to commit to main directly
Commit work using
and then use the Push
button in the Git RStudio pane
If you commit by accident to any branch, but particularly main
, you can undo the last commit
In fact, you can undo any number of last commits!
This has to be done in the Terminal
though ($)!
Resetting doesn’t delete
Be careful if you are trying to undo something sensitive, a reset is not a deletion
What if you’ve made a few changes that you want to keep but committed to main
?
main
terminal
to reset the commits you don’t want