I am quite new to RStudio and Git, so I would like to make sure that I understand correctly what I am doing.
The Git documentation says that git revert
creates a new commit. When I press the RStudio revert button, no new commit is created, it just goes back to the last commit. To me this seems to be a git reset --hard
. Did I get anything wrong?
RStudio Revert functionality differs from git reset
functionality.
According to this manual git reset --hard
do this
Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.
So your full project will return to previous commit state
But according to this RStudio Revert Changes popup window:
only selected file will be changed to previous commit state.
And this can be done with git combination of
git reset file
(Unstage a file) git checkout file
(Discard changes in the working directory)See more about resetting, checking and reverting here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With