How to go back to previous version in Studio?

Hi All,

I have 3 commit & push from studio to github

commit 1: first commit
commit 2: add message box
commit 3: add log message and remove message box

i can done above using studio commit & push feature, but how can i go back to previous version using studio, say go back to commit 2?

Is there any good video showing this?

Once successfully go back to commit 2, and i do some changes, how to make commit 4? There seems to be some error/ message pops?

one more question is what is your version control best practice?

thanks

1 Like

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:

  1. 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.
  1. 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.
  1. 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:

  1. Make New Changes:
  • Modify your workflows in Studio.
  1. 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).
1 Like

hi @Shakib

Thanks for the informative reply, im trying to follow your steps but face below issues at step 1

1.) No “Manage Branches” in Studio > Home > Team
Below is all i have

2.) I found manage branches at the bottom of studio, but no “Git History” option
Below is all i have

Can you please help? Thanks!

Hello @mlellison

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 :slight_smile:

https://dangitgit.com/

Regards
Soren

2 Likes

Hi @SorenB

Thanks a lot!
Do you mind to share how you do version control for UiPath? do you simply use git from command line?

No problem :slight_smile:

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.).

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.