1. How to Go Back to a Previous Commit (e.g., Commit 2) in UiPath Studio
UiPath Studio provides Git integration to help manage version control. To go back to a previous commit (e.g., Commit 2):
Steps:
Open the Git History Panel:
Go to Home > Team > Manage Branches in UiPath Studio.
In the Branches tab, click on Git History. This shows all commits in the branch.
Checkout the Desired Commit (Commit 2):
In the Git History window, locate “Commit 2: add message box.”
Right-click on this commit and choose Checkout or Reset.
Checkout: Makes your workspace match the commit without affecting the branch’s history.
Reset:
Select Soft Reset: Keeps changes in your working directory.
Select Hard Reset: Discards all changes after this commit.
Make the Checkout Official:
After resetting/checkout, your local workspace reflects the state of Commit 2.
Notes:
Warning Message: UiPath might warn you about uncommitted changes in your workspace. Ensure everything is committed before proceeding to avoid data loss.
Any changes after this step will branch off from Commit 2.
2. How to Make Commit 4 After Reverting to Commit 2
Once you’ve gone back to Commit 2:
Make New Changes:
Modify your workflows in Studio.
Stage and Commit Changes:
Use the Commit and Push feature in Studio.
This will create Commit 4 based on the state of Commit 2.
Error/Message Popups:
If a popup occurs saying “Cannot push,” it’s likely because your local branch is now different from the remote branch.
Use Force Push: In UiPath Studio, click Push with Force to overwrite the remote branch.
Alternative: Create a New Branch
If overwriting the remote branch isn’t desirable, create a new branch after going back to Commit 2.
Push changes in this new branch to avoid conflicts.
3. Best Practices for Version Control in UiPath Studio
Here are some best practices to manage version control effectively:
a. Commit Early, Commit Often
Commit frequently with meaningful commit messages to track progress and identify issues easily.
b. Use Branching Strategically
Use branches for feature development, bug fixes, or experiments.
Keep the main branch stable and production-ready.
c. Pull Before Pushing
Always pull the latest changes from the remote repository before pushing to avoid merge conflicts.
d. Use Descriptive Commit Messages
Use concise and meaningful commit messages, such as:
Add message box to workflow
Fix bug in logging activity
e. Avoid Force Push on Shared Branches
Force pushing on shared branches can lead to data loss for other collaborators. Only force push when absolutely necessary.
f. Tag Important Versions
Use tags to mark significant milestones (e.g., v1.0, v2.0).
g. Test Before Committing
Run your workflows and verify correctness before committing changes.
4. Recommended Videos
While I can’t link specific videos, you can look for videos on topics like:
“UiPath Studio Git integration tutorial”
“Reverting commits in Git using UiPath”
“Git version control for UiPath beginners”
You can explore tutorials on platforms like:
UiPath Academy
YouTube channels focusing on RPA (e.g., RPABotsWorld, UiPath Simplified).
To my knowledge there is no way of doing this reset inside Studio itself.
You could use other software to accomplish this, such as Sourcetree.
However it requires some setup for it to work.
Alternatively you could install GIT and simply use it from the command line.
For this method I suggest you take a look at the website Dangit, Git!?! which is a rather funny explanation of problems and mistakes in daily speech, translates into what you need to do in GIT
99% of the time I simply use the features that UiPath Studio offer.
Often I use the ability to Undo changes before the commit happens, but this ofcourse requires that you are aware that something unwanted has occurred.
I also use branches when developing, which allow me to review changes before applying them to the production.
If I need to reset a branch to a previous commit I have used Sourcetree, as it feels like the natural choice when using Bitbucket (both are Atlassian products).
However as noted previously you need to do a bit of setup first (installing GIT, setting up authorization etc.).