Showing posts with label Restore. Show all posts
Showing posts with label Restore. Show all posts

09 July 2021

How to get lost files back resulting from running git add and git restore -s@ -SW?

 How to get lost files back resulting from running git add and git restore -s@ -SW?


Problem

suppose you ran

$ git add .

then you ran

$ git status

and saw that you have added some files which you did not want to add. 

(You did not run 

$ git commit

)

then you wanted to remove them from the index.

In haste, you ran 

$ git restore -s@ -SW

resulting in those files are gone away from your working tree (resulted from -W).

You want to get them back.

Solution:

Run

$ git fsck --cach --no-reflogs --lost-found --unreachable head

You will get a list of SHA1, which point to your lost files.

Then run

$ git show SHA1 > name_of_lost_file

one by one, every lost file will now be in your current work directory!


08 June 2021

How to undo (almost) anything with Git

How to undo (almost) anything with Git


https://github.blog/2015-06-08-how-to-undo-almost-anything-with-git/



 

checkout, reset, restore, revert, and switch. What do they really do?

 checkout, reset, restore, revert, and switch. What do they really do?

Written by torek, etc.


https://stackoverflow.com/questions/58003030/what-is-the-git-restore-command-and-what-is-the-difference-between-git-restor


The whole page is useful, especially from 'To add to VonC's answer, and bring into the picture all the relevant commands, in alphabetical order, I will cover:'

I also like -

$git restore -s@ -SW -- <file> 

above the aforesaid section.



24 March 2016

Instructions on how to download and connect your server with ms sql database

1) please download the migrated database from the provided link.
2) In the zip folder you will find MDF and LDF files. Please attach it to your mssql server.
2) On the SysAid server, please go to servics.msc and stop the sysaid server service.
3) Go to SysAidServer\root\WEB-INF\conf folder,locate the file called "serverconf.xml" and edit it with notepad.
4) Find the following lines:

<dbConf>
<dbDriver>org.apache.derby.jdbc.EmbeddedDriver</dbDriver>
<dbUrl>jdbc:derby:default</dbUrl>
<dbUser>sysdba</dbUser>
<dbPassword>masterkey</dbPassword>
<dbType>derby</dbType>
<dbEncoding>utf-8</dbEncoding>
<dbMultiply>false</dbMultiply>
<dbMainName>ilient</dbMainName>
</dbConf>

And replace them with these lines :

<dbConf>
<dbDriver>net.sourceforge.jtds.jdbc.Driver</dbDriver>
<dbUrl>jdbc:jtds:sqlserver://"replace this with your database server's IP:1433/"replace this with the database name"</dbUrl>
<dbUser>"replace this with the database user name"</dbUser>
<dbPassword>"replace this with your database password"</dbPassword>
<dbType>mssql</dbType>
<dbEncoding>utf-8</dbEncoding>
<dbMultiply>false</dbMultiply>
<dbMainName>ilient</dbMainName>
</dbConf>


5) Once you finished to edit this file, save it, and close it.
6) Go to services.msc and start SysAid server service.
7) Make sure that you are able to log into SysAid.

* Please note that it is best to use the "SA" user from the database server, since this user is usally not restricted by any password policies of the organization.
* Also it is best to have the database owned by the "SA" user.